Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extract filename in path in cell excel (formul)?

I have paths in Excel column and I want extract filename in other cell without VBA.

/where/is/my/path/filename.txt

I would like extract "filename.txt"

like image 474
Thierry Avatar asked Aug 31 '25 21:08

Thierry


1 Answers

Here's a concise solution. It splits the full path by "/" and then grabs the last occurrence.

=CHOOSECOLS(TEXTSPLIT(A1,"/"),-1)

If you want to get just the file path as well, assuming you put the filename in column C:

=LEFT(A1,LEN(A1)-LEN(C1))
like image 178
Dan Avatar answered Sep 05 '25 03:09

Dan