Extract Text from End of Line back to Character

bokenrosie

New Member
Joined
Jun 13, 2014
Messages
48
Hello Mr. Excel,

I'm trying to extract everything from a character "\" to end of the line that it's in. My challenge is some of the lines have one "\" character and others have many.

I just need what appears after the last "\" to the end of the line.

Can anyone tell me what function I need to do?
 
Oops, put the wrong slash in my formula it should be
=TRIM(RIGHT(SUBSTITUTE(A2,"\",REPT(" ",100)),100))
 
Upvote 0

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Oops, put the wrong slash in my formula it should be
=TRIM(RIGHT(SUBSTITUTE(A2,"\",REPT(" ",100)),100))
Can i ask what the 100 100 means? I don't actually understand what this relates to - is it characters or words?

I'm trying to do the same and extract all the text after the last asterisks * in a cell

I've tried =TRIM(RIGHT(SUBSTITUTE(A2,"*",REPT(" ",LEN(A2))),LEN(A2))) - and this works 99.9% of the time but in single cell with hundreds of characters there seems to be a limit on how many * i can use in a single cell before it returns a value error. (I got to 25 sentences of *the quick brown fox jumped over the lazy dog in a single cell but the 26th time i try to add this line I get a value error)

*1
*12
*123
123
*1
*12
*123
*12345
*12345678910111213890087797878778787878781234233135343
#value!

=TRIM(RIGHT(SUBSTITUTE(A2,"*",REPT(" ",1500)),1500)) - works but it seems to count backwards from the very last character in a string rather than 1500 characters after the *

Is there a formula to return a limitless amount of text after the last asterisk * when there might be multiple * in a single cell?
 
Upvote 0
@Liverlee
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,361
Members
449,080
Latest member
Armadillos

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