Extract substring after last space in text

fklioside

Board Regular
Joined
May 6, 2013
Messages
51
I am trying to extract the last substring in some text that I have. Please see below for example.

12/30-12/31 Bob Dylan 40.25

I need to extract the 40.25 out. Every line item may be different but the number I am extracting is always after the last space. I tried using mid and find but this doesn't work well when there is more than 1 space in the text.

Thank you in advance!
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Supposing that the string is in cell A1, try this:

=RIGHT(A1,LEN(A1)-FIND("@",SUBSTITUTE(A1," ","@",(LEN(A1)-LEN(SUBSTITUTE(A1," ","")))/LEN(" "))))

The " " in the formula searches for the space character.
 
Upvote 0
Here is another formula for you to try...

=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",300)),300))
 
Upvote 0
Great that works! This formula has so many variables. I am trying to follow and understand it but not sure why or whne you would use these ><
 
Upvote 0
fklioside,

And, another variation:

=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",LEN(A1))),LEN(A1)))
 
Upvote 0

Forum statistics

Threads
1,215,269
Messages
6,123,976
Members
449,138
Latest member
abdahsankhan

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