Extract numeric substring after specific text

Bering

Board Regular
Joined
Aug 22, 2018
Messages
185
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I would like to extract a numeric substring after a specific text: in the example below, I would need the formula to return the numeric part of the string after "equivalent to ", hence 2,500,000.

Many thanks in advance for any ideas, formulae or vba.

equivalent to 2,500,000 USD at eur/usd rate 1.726
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hello,

I would like to extract a numeric substring after a specific text: in the example below, I would need the formula to return the numeric part of the string after "equivalent to ", hence 2,500,000.

Many thanks in advance for any ideas, formulae or vba.
If the text is in cell A1, you can use the below formula in B1
=VALUE(TRIM(MID(A1,14,FIND("USD",A1)-15)))
 
Upvote 0
Maybe something like:
(the value must be always between "to" and "USD")
Excel Formula:
=MID(A1,SEARCH("to ",A1)+3,SEARCH(" USD",A1)-SEARCH("to ",A1)-3)
 
Upvote 0
thanks everyone, however I should have made clear that the currency could be different than the one I used in my example...
 
Upvote 0
How about
Excel Formula:
=TRIM(LEFT(SUBSTITUTE(REPLACE(A2,1,FIND("to ",A2)+2,"")," ",REPT(" ",100)),100))
 
Upvote 0
Solution
How about
Excel Formula:
=TRIM(LEFT(SUBSTITUTE(REPLACE(A2,1,FIND("to ",A2)+2,"")," ",REPT(" ",100)),100))


Many thanks Fluff, that's perfect (y) Below is how I changed the formula to keep the substring numeric:

Excel Formula:
IFERROR(VALUE(TRIM(LEFT(SUBSTITUTE(REPLACE(E3,1,FIND("to ",E3)+2,"")," ",REPT(" ",100)),100))),0)
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,466
Messages
6,124,983
Members
449,201
Latest member
Lunzwe73

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