logo
search
Function Problems

How to Display the Worksheet Name in an Excel Cell

Huma Ashraf ChHuma Ashraf Ch Oct 7, 2026 869 views

Question details

The user wants to dynamically extract and display the current worksheet name inside an Excel cell for easier identification.

How to Display the Worksheet Name in an Excel Cell
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.
Before you start

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.

Solution 1Recommended

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.

1
Select the target cell

Click on the specific cell within your desktop Excel worksheet where you want the sheet name to appear.

2
Enter the extraction formula

Type the following formula exactly: =RIGHT(CELL("filename",A1),LEN(CELL("filename",A1))-FIND("]",CELL("filename",A1)))

3
Apply the formula

Press Enter. The cell will calculate the file path and display just the name of the current worksheet.

Extract the Worksheet Name Using the CELL Formula
Excel for the Web Limitations: The CELL("filename") function is strictly supported in the Excel desktop application. If you open the same workbook in Excel for the web, the formula will not calculate correctly.
Efficient Spreadsheet Tool

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. 1. Save your spreadsheet: Open your file in WPS Spreadsheet and save the workbook locally.
  2. 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. 3. View the result: Press Enter to instantly display the active worksheet's name in the selected cell.
Fully compatible with Microsoft Excel (.xlsx) formats and advanced formulasNatively supports the CELL function for extracting file paths and sheet namesLightweight, fast, and free to download for desktop usersFamiliar user interface requiring zero learning curve
microsoft office alternative - wps office

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.