Excel Office

Excel How Tos, Tutorials, Tips & Tricks, Shortcuts

How to get sheet name only in Excel

If you want to get the sheet name only (i.e. the sheet name without the file name or path) you can do so with rather long formula that uses the MID function along with the FIND function. The final result will look something like this:





How the formula works

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


The result looks like this:


The full file name plus path and sheet is fed into the MID function, which is used to extract just the sheet name.

Also See:   Remove last characters from right in a cell in Excel

The starting position is calculated with FIND:


The number of characters to extract is supplied as 255. In the Excel UI, you can’t name a worksheet longer than 31 characters, but the file format itself permits worksheet names up to 255 characters.

Alternative with RIGHT

Several readers have mentioned an alternative like this with the RIGHT function:


A few more function calls, but a perfectly valid formula.

Also See:   Manipulating text strings using Left, Mid, Right, Len, Substitute in Excel

Leave a Reply

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