Excel Office

Excel How Tos, Tutorials, Tips & Tricks, Shortcuts

How to retrieve workbook name only in Excel

If you want to get the workbook name only (i.e. the file name without path or sheet name) you can do so with a rather long formula that uses the MID function along with the FIND function.

Worked Example:   Extract middle name from full name -- Manipulating NAMES in Excel




How the formula works

The cell function is used to get the full file name and path:


The result looks like this:


At the highest level, the MID function simply extracts the file name from the path and sheet. The starting position is calculated with FIND:


The number of characters to extract is also calculated with FIND:


Leave a Reply

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