ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to extract only file name from folder path string in Excel? (https://www.excelbanter.com/excel-worksheet-functions/225007-how-extract-only-file-name-folder-path-string-excel.html)

JayKay

How to extract only file name from folder path string in Excel?
 
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

Bernie Deitrick

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





All times are GMT +1. The time now is 11:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com