Extract Dollar Amounts From Cells that Contain Additional Data and Vary in Position for Google Sheets

ClimaPod

New Member
Joined
Aug 16, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hello! I'm trying to extract dollar amounts from a cell that contains additional data and the dollar amounts can vary in position. The dollar amounts are all formatted with a $ but are not all the same length after. For example, if you look at the below screenshot, you'll see column R is labeled 'Notes / Ship Rates / Tracking' and column S is where I'm trying to extract the 'Ship Rates' to.

I found a similar situation through a different post which provided the formula you can see being used in the screenshot:

=MID(R2,FIND("$",R2),FIND(" ",R2&" ",FIND("$",R2))-FIND("$",R2))

As you can see, in Column S the formula is extracting the shipping rate, but it's also pulling over the first word (Tracking) in the next line down. I've tried adjusting the formula but can't seem to figure out how to get it to pull only the Shipping rate without any additional information. Any thoughts or suggestions?

1629135457163.png


Here is the link to the post I was referencing in case it may be helpful.
 
Last edited by a moderator:

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi & welcome to MrExcel.
Is this for Excel or Google Sheets?
 
Upvote 0
Without seeing your actual file, this is only a guess. I am guessing that there is no space after the price just a line feed. Therefore the next space is after "Tracking."
 
Upvote 0
With data as shown in example

Try


Extract Dollar Amounts From Cells that Contain Additional Data and Vary in Position.xlsx
ABC
1DataTextNumber
2order # #7674 FQ Estes $447.88 Tracking # 12345$447.88447.88
3PROMISED SHIP IN JULY FQ XPO $418.86 Tracking # 12345$418.86418.86
4UPS $22.56 Tracking 12345 Paid 7/21/2021$22.5622.56
5FQ Estes $448.95 Tracking # 12345 Paid 8/5/2021$448.95448.95
6order # 7678 GF ABF $523.17 Tracking # 12345 Paid 8/4/2021$523.17523.17
Sheet1
Cell Formulas
RangeFormula
B2:B6B2=TRIM(LEFT(SUBSTITUTE(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,CHAR(10),"@",2),CHAR(10),"@",1),CHAR(10),"@",3),FIND("$",SUBSTITUTE(A2,CHAR(10),"@",2)),99),"@",REPT(" ",99)),99))
C2:C6C2=TRIM(LEFT(SUBSTITUTE(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,CHAR(10),"@",2),CHAR(10),"@",1),CHAR(10),"@",3),FIND("$",SUBSTITUTE(A2,CHAR(10),"@",2)),99),"@",REPT(" ",99)),99))+0


if you want dollar amounts as numbers try formula in column C
 
Last edited:
Upvote 0
Hi & welcome to MrExcel.
Is this for Excel or Google Sheets?
Hello, this is for Google sheets. I believe the formula that Sufiyan97 shared is going to do the trick for me though. I need to leave the office for the day so I will have to investigate this further tomorrow and then follow up.
 
Upvote 0
@Fluff
What was the clue that made you ask if this was a Google Sheets issue? I didn't see anything.
Alan
 
Upvote 0
Another option that should work with sheets
+Fluff 1.xlsm
AB
1Data
2order # #7674 FQ Estes $447.88 Tracking # 12345447.88
3PROMISED SHIP IN JULY FQ XPO $418.86 Tracking # 12345418.86
4UPS $22.56 Tracking 12345 Paid 7/21/202122.56
5FQ Estes $448.95 Tracking # 12345 Paid 8/5/2021448.95
6order # 7678 GF ABF $523.17 Tracking # 12345 Paid 8/4/2021523.17
Master
Cell Formulas
RangeFormula
B2:B6B2=LEFT(REPLACE(A2,1,FIND("$",A2),""),FIND(" ",SUBSTITUTE(REPLACE(A2,1,FIND("$",A2),""),CHAR(10)," "))-1)
 
Upvote 0
@Fluff. We should change your moniker to "Eagle Eye" :) I had to look at it several times after you posted to note the difference.
 
Upvote 0

Forum statistics

Threads
1,215,762
Messages
6,126,736
Members
449,334
Latest member
moses007

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