Sheet Name Code Excel

This article outlines how to display the name of a sheet in Excel.

Getting the sheet name code in Excel

In Excel, if you want to display the name of a Sheet in a cell you can use a combination of formulas to display it. Getting the sheet name code requires combining the MID, CELL and FIND functions into one formula.

For example, if you are printing out a financial model onto paper or as a PDF you may want to display each sheet name on the top of each page.   You can now easily do so by using this formula.

Download the Free Excel Template – Sheet Name Formula

Sheet name formula


(See screenshots below)

Example of creating the sheet name code

Step 1: Type “CELL(“filename”,A1)”. The cell function is used to get the full filename and path . This function returns the filename of .xls workbook, including the sheet name.  This is our starting point, and then we need to remove the file name part and leave only the sheet name.

Step 2: Type “FIND(“]”,CELL(“filename”)+1,500″.  Essentially what the formula does is it goes into the file name, finds the “]” which is where the workbook name ends.  From there it moves over one character (+1) to where the sheet name starts.  Finally, we add 500 to the end, or any number that is larger than the number of characters a sheet name would realistically have.

Congratulations, you have now displayed the name of a sheet in Excel!

Download the free template.

More excel development