How to Use an Excel Formula to Return the Current Worksheet Name
Question details
The user needs a reliable formula to automatically display the name of the active worksheet inside a cell to help create an index for large workbooks.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Managing large workbooks with numerous tabs where dynamically referencing sheet names is required to build automated tables of contents.
- Observed behavior
- The user is seeking a way to automatically extract and return the active worksheet's name directly within a cell using native functions or macros.
Before applying the formula, you must save your workbook at least once. The native CELL function relies on the file's saved path, so it will return a blank value in unsaved, newly created files.
Use the Native CELL, MID, and FIND Functions
This is the most reliable native method to dynamically display the current sheet name without needing to enable macros.
This combination of formulas extracts the full file path and isolates the text that appears after the closing bracket ']' which denotes the worksheet name.
Click 'File' and select 'Save' to save your workbook locally. The file must have a saved directory path for the formula to work.
Click on the cell where you want the worksheet name to appear.
Type the following formula exactly: `=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)` and press Enter. You can replace 'A1' with any cell reference on the current sheet.

Create a Custom VBA Function to Get Sheet Names by Index
Use this VBA user-defined function if you need to pull worksheet names dynamically by their numerical index to create a master table of contents.
Easily Manage Large Workbooks with WPS Spreadsheet
WPS Spreadsheet fully supports advanced text extraction formulas like CELL, MID, and FIND natively. It easily handles complex formulas and VBA macros to streamline your data management.
- 1. Download and Install WPS Office: Install WPS Office for free and open your spreadsheet document.
- 2. Save your document: Save your document to your local drive to ensure the file path is registered by the system.
- 3. Input the extraction formula: Type `=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)` into any cell and hit Enter to instantly reveal the sheet name.

Frequently Asked Questions
Why does the formula return a blank result or an error?
The CELL("filename") function requires the workbook to have an established save path. If you are working in a brand-new, unsaved file, the formula will return blank. Save the file to your computer and press F9 to refresh.
Can I use this formula to get the name of a different worksheet?
Yes, you can extract the name of a different sheet by changing the cell reference inside the formula. For example, replacing A1 with Sheet2!A1 will return the name of that specific sheet instead of the active one.
Will the formula update automatically if I rename the tab?
Yes, the formula is dynamic and will reflect the new tab name. If it does not update instantly, you may need to force a calculation by pressing F9 or double-clicking the cell and hitting Enter.




