Function Problems

Display an Excel Workbook File Name and Path with CELL

Bushra ParveenBushra Parveen Nov 18, 2026 869 views

Question details

Display the full path, workbook file name, and worksheet name in an Excel cell.

Display an Excel Workbook File Name and Path with CELL
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user wants a formula that shows where the current workbook is saved and identifies the worksheet.
Observed behavior
A cell displays the saved workbook's path and file name, with or without the worksheet name.
Before you start

Save the workbook using File > Save or Save As before entering the formula. CELL cannot return the file name and path for a workbook that has not been saved.

Solution 1Recommended

Display the workbook path, file name, and sheet name

Use CELL with a worksheet reference to show the full workbook location and sheet name.

1
Select a cell

Open the saved workbook and click the cell where you want the location to appear.

2
Enter the CELL formula

Type =CELL("filename",A1) and press Enter. The A1 reference identifies the worksheet whose name should be returned.

3
Check the result

Look at the selected cell for a result such as C:\Reports\[Budget.xlsx]Sheet1. The exact path depends on where the workbook is saved.

Display the workbook path, file name, and sheet name
Save the workbook first: If the workbook has never been saved, use File > Save As and then check the formula again.
WPS Spreadsheets

Show a Workbook File Path in WPS Spreadsheets

Use the CELL function in WPS Spreadsheets to display a saved workbook's path, file name, and worksheet name in a cell.

  1. 1. Open the workbook: In WPS Spreadsheets, select Open and choose your workbook.
  2. 2. Save the file: Use File > Save or Save As if the workbook has not yet been saved.
  3. 3. Enter the formula: Click a cell, type =CELL("filename",A1), and press Enter to display the path, workbook name, and sheet name.
  4. 4. Remove the sheet name if needed: To show only the path and file name, enter =SUBSTITUTE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1),"[","") in a cell.
Display workbook location details with a CELL formulaOpen and edit Microsoft Excel XLSX and XLS filesWork with spreadsheets in a familiar, easy-to-use interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does CELL return an empty result for the file name?

The workbook may not have been saved yet. Use File > Save As to save it, then check =CELL("filename",A1) again.

How do I show the file path without the worksheet name?

Enter =SUBSTITUTE(LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1))-1),"[","") in a cell. This formula may not work correctly if the path or file name contains square brackets.

Why include A1 in the CELL formula?

In =CELL("filename",A1), A1 identifies the worksheet whose name should appear. Use a reference on the worksheet you want to identify.

Can I use the same formula in WPS Spreadsheets?

Yes. Open and save the workbook in WPS Spreadsheets, then enter =CELL("filename",A1) in a cell to display its location and worksheet name.