Truncating in Excel

  • I absolutley cannot figure out how to get what I'm trying to obtain. I'm able to obtain the full path of any various file a user choose and that file path is displayed in a cell. I need to display the actual file name in the cell below it. So basically, I can see C:\users\username\desktop\filename. The file path and name is not constant so I'm trying to figure out how I can write a formula that will start on the right, find the first "\" and remove that along with everything to the left of it leaving only the file name. Here is what I've tried.


    =RIGHT(L4, LEN(L4)-SEARCH("\", L4)) which results in displaying users\username\desktop\filename. I've tried several variations of this formula and gotten everything but the file name. Any suggestions?

  • Re: Truncating in Excel


    Hi.. I just spent about 30 minutes trying to work this out.. (mainly because I am hopeless at formulas and need practise)..


    Anyway.. I gave up. and then googled an answer for you... :)


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


    Drag down...


    Found it here..


    http://www.ozgrid.com/forum/showthread.php?t=75212

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!