Extract second to last number from string

DerekWooley

New Member
Joined
May 1, 2018
Messages
34
Hello, what formula could I use to extract the second to last and third to last numbers from the below string separately? I want to pull 4.410 out and then the 5.007 out.

704938 1-6/9" Dia. 12L14 Metal Row Hard 1 5.007 4.410 4.4330

the string is located in cell A10.

I extracted the last number (4.430)using : =RIGHT(A10,LEN(A10)-FIND("*",SUBSTITUTE(A10," ","*",LEN(A10)-LEN(SUBSTITUTE(A10," ","")))))

Thank you for any help.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Will it always be 3 numbers at the end of the string? Or could you have other text after the last number? And are the numbers always 5 characters long (including decimal) ?



For the example above if the format is exactly the same for all strings...

2nd to last number
=MID(A10,FIND("@",SUBSTITUTE(A10," ","@",(LEN(A10)-LEN(SUBSTITUTE(A10," ","")))-1))+1,5)

3rd to last number
=MID(A10,FIND("@",SUBSTITUTE(A10," ","@",(LEN(A10)-LEN(SUBSTITUTE(A10," ","")))-2))+1,5)
 
Last edited:
Upvote 0
d10=TRIM(MID(SUBSTITUTE($A10," ",REPT(" ",500)),(SUMPRODUCT((MID($A10,ROW($1:$999),1)=" ")*1)-COLUMN(A1))*500,500)) copy to E10
 
Upvote 0
How about

Excel 2013 32 bit
ABCD
1704938 1-6/9" Dia. 12L14 Metal Row Hard 1 5.007 4.410 4.43305.0074.4104.4330
Sheet3
Cell Formulas
RangeFormula
B1=TRIM(LEFT(RIGHT(SUBSTITUTE(A1," ",REPT(" ",200)),600),200))
C1=TRIM(LEFT(RIGHT(SUBSTITUTE(A1," ",REPT(" ",200)),400),200))
D1=RIGHT(A1,SEARCH(" ",A1)-1)
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0
Hi Fluff,

Your D1 formula in Post # 4 might need some tweaking...
 
Upvote 0
You're quite right, not quite sure what I was thinking when I did that, but by pure fluke it worked on this occasion.
it should be
=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",200)),200))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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