Excel Formula to Extract Last Subfolder in a File Path

Excel Formula to Extract Last Subfolder in a File Path

May 4, 2016

Here's a series of Excel formulas which will allow you to extract the last subfolder in a file path.  Starting with the file path in column A enter the following formulas in columns B, C, and D:

 

=FIND("|",SUBSTITUTE(A1,"\","|",LEN(A1)-LEN(SUBSTITUTE(A1,"\",""))-1))

 

=FIND("\",A1,B1+1)

 

=MID(A1,B1+1,(C1-B1)-1)

 

The first formula indicates how many characters into column A the next to last backward slash is.  The second formula indicates the position in the file path that the last backward slash appears at.  The last formula find the text between the beginning and ending points listed in columns B and C. 

Thanks to Todd for posting this solution at http://superuser.com/questions/969898/split-folder-paths-in-excel-to-return-the-final-folder

 

 

Please reload

Contact Me With Your Litigation Support Questions:

seankevinoshea@hotmail.com

  • Twitter Long Shadow

© 2015 by Sean O'Shea . Proudly created with Wix.com