View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default How to extract only file name from folder path string in Excel?

JayKay,

For a string in cell A1, array enter (enter using Ctrl-Shift-Enter) this formula

=RIGHT(A1,LEN(A1)-MAX((MID(A1,ROW(INDIRECT("1:" & LEN(A1))),1)="\")*ROW(INDIRECT("1:" & LEN(A1)))))

HTH,
Bernie
MS Excel MVP


"JayKay" wrote in message
...
I need to extract the file names from folder path strings in a worksheet Cell
using Worksheet functions. The number of folder levels is variable:

\\test server\app1\Test Files\File Set1\Bin_S(A)

\\test server\app1\Test Files\File Set2\Test Case1\Full Regression