How to Display the Worksheet Name in an Excel Cell
Question details
The user wants to dynamically extract and display the current worksheet name inside an Excel cell for easier identification.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Displaying the current sheet name dynamically within a cell using an Excel formula.
- Observed behavior
- The standard CELL formula successfully extracts the sheet name in the desktop application but is unsupported and returns an error in Excel for the web.
Ensure you have saved your workbook at least once to your local drive. The formula relies on reading the file's save path, which does not exist for new, unsaved workbooks.
Extract the Worksheet Name Using the CELL Formula
Use a combination of text manipulation formulas (RIGHT, LEN, FIND) alongside the CELL function to isolate the worksheet name from the file path.
The CELL("filename") function returns the full file path of the workbook, including the sheet name at the very end enclosed in brackets. By using text extraction functions, we can strip away the folder path and workbook name, leaving only the active sheet name.
Click on the specific cell within your desktop Excel worksheet where you want the sheet name to appear.
Type the following formula exactly: =RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))
Press Enter. The cell will calculate the file path and display just the name of the current worksheet.

Manage Advanced Formulas Seamlessly with WPS Office
WPS Spreadsheet fully supports the CELL function and advanced text extraction formulas, allowing you to display worksheet names dynamically. Enjoy a seamless, desktop-level spreadsheet experience with powerful data management capabilities.
- 1. Save your spreadsheet: Open your file in WPS Spreadsheet and save the workbook locally.
- 2. Input the formula: Select an empty cell and enter the formula: =RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))
- 3. View the result: Press Enter to instantly display the active worksheet's name in the selected cell.

Frequently Asked Questions
Why does the CELL formula return a #VALUE! error?
This error typically occurs if the workbook has never been saved. The CELL("filename") function requires a saved file path to work. Save your document to your computer, then press F9 to recalculate the formula.
Will the formula update automatically if I rename the worksheet?
Yes, but it may not update instantly depending on your calculation settings. If you rename the sheet and the cell doesn't update, press the F9 key on your keyboard to force Excel to recalculate the sheet.
Is there a formula that works in Excel for the web?
Currently, Excel for the web does not support the CELL function used to extract file paths. There is no built-in formula alternative for the browser version; you must use the desktop application for this specific function.
Why is 'A1' included in the CELL formula?
Including a cell reference like 'A1' ensures the formula retrieves the name of the specific worksheet where 'A1' is located. If omitted, the formula might display the name of the last modified worksheet instead of the current one.




