How to extract part of a filename in Excel

Posted on

QUESTION :

I saw a post about using the CELL function to return and extract the filename as ABC.xlsx. The formula used was:

=REPLACE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1),1,FIND("[",CELL("filename",A1)),"")

I only want to show ABC without the .xlsx filetype extension. How do I modify the formula to show only ABC?

ANSWER :

=LEFT(CELL("filename",A1), LEN(CELL("filename",A1))-4)

Leave a Reply

Your email address will not be published. Required fields are marked *