Text Needed to the right of text

Silvermini63

Active Member
Joined
Sep 25, 2006
Messages
293
I have a cells full of text and I need to split out from it everything that is right of the 3rd to last space in the string.

The common in the strings is all the info I need starts after the 3rd space from the end of the text.
The issue is everything to the left of that 3rd to last space is a different length
eg:
product 1 010001 6 $10.00
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
product 1 010001 6 $10.00</SPAN>
010001 6 $10.00</SPAN>
prodctac ak 1 01001 6 $20</SPAN>
01001 6 $20</SPAN>
kaka iom spp 2 01000 9 $30</SPAN>
01000 9 $30


</SPAN>

<TBODY>
</TBODY>
B1 copy down:
=TRIM(RIGHT(SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))-3),LEN(A1)-FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))-3))-1))
 
Last edited:
Upvote 0
Assuming your text is never longer than 99 characters, then I am pretty sure this formula will return what you want...

=TRIM(RIGHT(SUBSTITUTE(" "&A1," ",REPT(" ",99)),198))

If your text could be longer, then change the 99 to the maximum possible length and replace the 99 with double whatever that maximum possible length is.
 
Last edited:
Upvote 0
Both don’t work to how I need it to the first one seems to find the Number after the product in my example; product 1 it then will return what is after that but in real terms my products don’t have that number after it.

The second returns everything after the code so in my example it returns 6 $10.00 not 010001 6 $10.00

So my real products maybe
Rice long grain 010001 6 $10.00
Par baked bread 010022 42 $25.00

So I would need
010001 6 $10.00
010022 42 $25.00

Thanks so far for your help I think we are close
 
Upvote 0
Both don’t work to how I need it to the first one seems to find the Number after the product in my example; product 1 it then will return what is after that but in real terms my products don’t have that number after it.

The second returns everything after the code so in my example it returns 6 $10.00 not 010001 6 $10.00
Sorry, my fault. I thought I changed the last value in my formula before posting it so that it would grab the correct text, but I see that the value didn't update. No problem, this formula should do what you want (just had to add 99 to the value for what ended up getting posted)...

=TRIM(RIGHT(SUBSTITUTE(" "&A1," ",REPT(" ",99)),297))
 
Upvote 0

Forum statistics

Threads
1,206,945
Messages
6,075,782
Members
446,156
Latest member
Aaro23

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