How to Extract Multiple Values from Text without VBA?

Mekdam

New Member
Joined
Aug 24, 2020
Messages
3
Office Version
  1. 2010
Platform
  1. Windows
I have a text file that I converted to Excel;
Each line has $ value (S) as below:

Richard Deposited +$100000.
Bob Lost -$43.
Richard Lost -$444.
Bob Lost -$4356 and Richard won +$5500
Bob Lost -$4356 and Richard won +$3000
Bob Lost -$4356.
Bob Lost -$373 and Alles won +$1322.
Bob Lost -$388.
Alles Lost -$3.
Alles Lost -$94829.
Alles Lost -$63489.
Alles Lost -$84689 and Alles won +$9987.
Alles Lost -$60489.
Alles Lost -$799356.
Bob Lost -$432256.
Bob Lost -$435116.
Richard Lost -$63546.
Bob Lost -$324467.
Richard Lost -$4356.
Bob Lost -$4356 and Richard won +$4356.
Bob Lost -$4356 and Alles won +$5468.


I need to extract the numbers associated with the $ value and sign (-/+) without VBA; to process the mathematical equations for them in Excel.
The issue is that I have single or multiple $ value in each string;
How to do that?
Thanks in advance for help.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
There must be a better way (other than VBA)...but this might get you started. I assumed per your example that the positives are always at the end.

Book1
ABC
1PositivesNegatives
2Richard Deposited +$100000.100000 
3Bob Lost -$43. -43
4Richard Lost -$444. -444
5Bob Lost -$4356 and Richard won +$55005500-4356
6Bob Lost -$4356 and Richard won +$30003000-4356
7Bob Lost -$4356. -4356
8Bob Lost -$373 and Alles won +$1322.1322-373
9Bob Lost -$388. -388
10Alles Lost -$3. -3
11Alles Lost -$94829. -94829
12Alles Lost -$63489. -63489
13Alles Lost -$84689 and Alles won +$9987.9987-84689
14Alles Lost -$60489. -60489
15Alles Lost -$799356. -799356
16Bob Lost -$432256. -4322
17Bob Lost -$435116. -4351
18Richard Lost -$63546. -63546
19Bob Lost -$324467. -3244
20Richard Lost -$4356. -4356
21Bob Lost -$4356 and Richard won +$4356.4356-4356
22Bob Lost -$4356 and Alles won +$5468.5468-4356
Sheet1
Cell Formulas
RangeFormula
B2:B22B2=IF(ISERROR(FIND("+$",A2)),"",1*MID(A2,2+FIND("+$",A2),100))
C2:C22C2=IF(ISERROR(FIND("-$",A2)),"",(-1)*MID(A2,2+FIND("-$",A2),FIND(" ",SUBSTITUTE(A2,"."," "))))
 
Last edited:
Upvote 0
Sorry, but that fails with other names ... will try to fix.
 
Upvote 0
Here are a couple of formulas to consider

varios 24ago2020.xlsm
ABC
1PositiveNegative
2Richard Deposited +$100000.100000 
3Bob Lost -$43. 43
4Richard Lost -$444. 444
5Bobanytext Lost -$4356 and Richard won +$550055004356
6Bob Lost -$4356 and Richard won +$300030004356
7Bob Lost -$4356. 4356
8Bob Lost -$373.15 and Alles won +$1322.281322.28373.15
9Bob Lost -$388. 388
10Alles Lost -$3. 3
11Alles Lost -$94829. 94829
12Alles Lost -$63489. 63489
13Allescon Lost -$84689 and Alles won +$9987.998784689
14Alles Lost -$60489. 60489
15Alles Lost -$799356. 799356
16Bob Lost -$432256. 432256
17Bob Lost -$435116. 435116
18Richard Lost -$63546. 63546
19Bob Lost -$324467. 324467
20Richard Lost -$4356. 4356
21Bob Lost -$4356 and Richard won +$4356.43564356
22Bob Lost -$4356 and Alles won +$5468.54684356
Hoja6
Cell Formulas
RangeFormula
B2:B22B2=IFERROR(LEFT(SUBSTITUTE(REPLACE(A2,1,FIND("+$",A2)+1,"")," ",REPT(" ",250)),250)+0,"")
C2:C22C2=IFERROR(LEFT(SUBSTITUTE(REPLACE(A2,1,FIND("-$",A2)+1,"")," ",REPT(" ",250)),250)+0,"")
 
Upvote 0
I think this fixes the issue in C2 and filled down:

Code:
=IF(ISERROR(FIND("-$",A2)),"",(-1)*MID(A2,2+FIND("-$",A2),FIND(" ",RIGHT(SUBSTITUTE(A2,"."," "),LEN(A2)-1-FIND("-$",A2)))))

And I KNEW someone like Dante would come up with a slick solution!
 
Upvote 0
Here are a couple of formulas to consider

varios 24ago2020.xlsm
ABC
1PositiveNegative
2Richard Deposited +$100000.100000 
3Bob Lost -$43. 43
4Richard Lost -$444. 444
5Bobanytext Lost -$4356 and Richard won +$550055004356
6Bob Lost -$4356 and Richard won +$300030004356
7Bob Lost -$4356. 4356
8Bob Lost -$373.15 and Alles won +$1322.281322.28373.15
9Bob Lost -$388. 388
10Alles Lost -$3. 3
11Alles Lost -$94829. 94829
12Alles Lost -$63489. 63489
13Allescon Lost -$84689 and Alles won +$9987.998784689
14Alles Lost -$60489. 60489
15Alles Lost -$799356. 799356
16Bob Lost -$432256. 432256
17Bob Lost -$435116. 435116
18Richard Lost -$63546. 63546
19Bob Lost -$324467. 324467
20Richard Lost -$4356. 4356
21Bob Lost -$4356 and Richard won +$4356.43564356
22Bob Lost -$4356 and Alles won +$5468.54684356
Hoja6
Cell Formulas
RangeFormula
B2:B22B2=IFERROR(LEFT(SUBSTITUTE(REPLACE(A2,1,FIND("+$",A2)+1,"")," ",REPT(" ",250)),250)+0,"")
C2:C22C2=IFERROR(LEFT(SUBSTITUTE(REPLACE(A2,1,FIND("-$",A2)+1,"")," ",REPT(" ",250)),250)+0,"")
Thanks a lot Dante
 
Upvote 0
Select column A,
click on the Data tab
select text to columns
delimited, next
select space or use a $ sign or +/- sign
next
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,573
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top