right trimming?

kin1

New Member
Joined
Mar 31, 2011
Messages
37
hello,i have a situation where i have a column of data that i want to split out, it's base on file locations and i only want the file name.example;c:\testfile\maincust\custa\file1.docc:\testfile\maincust\custb\important\important1.docc:\testfile\maincust\custb\important\responded\response1.docwith the example above, i only want to get the last portion to the right of the last "\". is there a way to do that? the result should befile1.docimportant1.docresponse1.docthanks!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
One of these formulas (which depending on if your filenames have leadigin or multiple embedded spaces in them) should do what you want....

No spaces
------------------------------------
=TRIM(RIGHT(SUBSTITUTE(A1,"\",REPT(" ",99)),99))

With spaces
-----------------------------------
=SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(A14," ",CHAR(1)),"\",REPT(" ",99)),99)),CHAR(1)," ")
 
Upvote 0
that is really cool, thank you. i will have to experiment with the repeat function now.thanks!
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,761
Members
452,940
Latest member
rootytrip

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