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?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Try this

Book1
FGHI
8gaga/afsyaj/atatav/jaja
9
10
11
Sheet5
Cell Formulas
RangeFormula
I8I8=MID(F8,SEARCH("||",SUBSTITUTE(F8,"/","||",LEN(F8)-LEN(SUBSTITUTE(F8,"/",""))))+1,999)
 
Upvote 0
Is Yourstuff supposed to be the column with the string? column A has my list in it. replacing Yourstuff with A2 did not seem to work.
 
Upvote 0
Try this

Book1
FGHI
8gaga/afsyaj/atatav/jaja
9
10
11
Sheet5
Cell Formulas
RangeFormula
I8I8=MID(F8,SEARCH("||",SUBSTITUTE(F8,"/","||",LEN(F8)-LEN(SUBSTITUTE(F8,"/",""))))+1,999)
That looks like exactly what I want. I tried replacing F8 with A2 and it did not work.
 
Upvote 0
Another option
=TRIM(RIGHT(SUBSTITUTE(A2,"/",REPT(" ",100)),100))
 
Upvote 0
Maybe I did'nt explain well. Please look at the follwoing, on the left column is what I have and on the Filename is the result I'm looking for. I've tried to the two methods suggested and they are not giving me this result. thank for trying.

LocationFilename
c:\users\joe\projects\smith\Excel Examples.jpgExcel Examples.jpg
c:\users\tom\projects\demos\2002\My First File.docMy First File.doc
c:\users\mary\Green Leaves.mpgGreen Leaves.mpg
 
Upvote 0
=MID(F8,SEARCH("||",SUBSTITUTE(F8,"\","||",LEN(F8)-LEN(SUBSTITUTE(F8,"\",""))))+1,999)

Syntax Error
 
Upvote 0
Hello, I hope this helps
Book2
AB
1c:\users\joe\projects\smith\Excel Examples.jpgExcel Examples.jpg
2c:\users\tom\projects\demos\2002\My First File.docMy First File.doc
3c:\users\mary\Green Leaves.mpgGreen Leaves.mpg
4
Sheet1
Cell Formulas
RangeFormula
B1:B3B1=TRIM(RIGHT(SUBSTITUTE(A1,"\",REPT(" ",LEN(A1))),LEN(A1)))
 
Upvote 0
with Power Query
LocationText After Delimiter
c:\users\joe\projects\smith\Excel Examples.jpgExcel Examples.jpg
c:\users\tom\projects\demos\2002\My First File.docMy First File.doc
c:\users\mary\Green Leaves.mpgGreen Leaves.mpg

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    TAD = Table.AddColumn(Source, "Text After Delimiter", each Text.AfterDelimiter([Location], "\", {0, RelativePosition.FromEnd}), type text)
in
    TAD
 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,736
Members
448,988
Latest member
BB_Unlv

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