Extract Dollar value from a text String

Kyosti

Board Regular
Joined
Jun 2, 2008
Messages
90
Hello all,
It has been awhile since I have asked for help, but I need a quick hand. I need to extract a dollar value from the text below.


“I spoke with F on phone number f regarding the status of policy number f. I advised that current amount due of $10. includes a past due amount of $10. that is due before 8/14 to avoid cancellation of the policy. To prevent a loss of coverage, F made a payment of $20.0 with (CPay). The reference number for the payment made is (reference).”


I need to be able to pull the different dollar values based on the text that precedes them. For example I need one for the “amount due”, another for the “Past due” and the last for the “Payment of”. This way I can extract the three different values into 3 different cells. The verbiage is the criteria because it will always be the same.


I tried searching for something that would help and I found this but it will only return the first value found, and I cannot figure out how to adjust it.


=MID(B4,FIND("$",B4),FIND(" ",B4&" ",FIND("$",B4))-FIND("$",B4))+0


Thanks again in advance.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
There is probably a better way, but this seems to work. I changed your dollar amounts to check that it was picking up the correct data.
Excel Workbook
ABCD
4I spoke with F on phone number f regarding the status of policy number f. I advised that current amount due of $10. includes a past due amount of $10.25 that is due before 8/14 to avoid cancellation of the policy. To prevent a loss of coverage, F made a payment of $20.25 with (CPay). The reference number for the payment made is (reference).
5
6Amount Due10
7Past Due10.25
8Payment20.25
Sheet
 
Upvote 0
I may have spoken too soon. When I tried applying the formula to another text, the columns did not pull the data as expected. The text is the same the only difference is the dollar amounts.
 
Upvote 0
How about posting a copy of the text that is causing the error.
 
Upvote 0
So this is one of the other text strings. The error appears on the third value where a payment is being made, which of course is the most important one. The text only changes on customer information and payment amount so I don't know why it works on the first example, but not the second!!! Please help!!

'I spoke with Customer Name on phone number 555-555-5555 regarding the status of policy number 123456789. I advised that current amount due of $28.03 includes a past due amount of $14.02 that is due before 8/16/2018 to avoid cancellation of the policy. To prevent a loss of coverage, Customer Name made a payment of $104.11 with a Visa. The reference number for the payment made is 123456789.
 
Upvote 0
Hi,

Try this:


Book1
BCDEF
4I spoke with F on phone number f regarding the status of policy number f. I advised that current amount due of $10. includes a past due amount of $10. that is due before 8/14 to avoid cancellation of the policy. To prevent a loss of coverage, F made a payment of $20.0 with (CPay). The reference number for the payment made is (reference).101020
5I spoke with Customer Name on phone number 555-555-5555 regarding the status of policy number 123456789. I advised that current amount due of $28.03 includes a past due amount of $14.02 that is due before 8/16/2018 to avoid cancellation of the policy. To prevent a loss of coverage, Customer Name made a payment of $104.11 with a Visa. The reference number for the payment made is 123456789.28.0314.02104.11
Sheet167
Cell Formulas
RangeFormula
D4=LEFT(SUBSTITUTE(TRIM(MID(SUBSTITUTE($B4,"$",REPT(" ",LEN($B4)),COLUMNS($D4:D4)),LEN($B4),LEN($B4)))," ",REPT(" ",15)),15)+0


D4 formula copied down and across to F5.

EDIT: If you want the results Vertically placed ( In Same Column ) rather than Horizontally as in my sample, my formula needs to be modified.

Let me know.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,500
Members
449,090
Latest member
RandomExceller01

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