How to Fix Excel CELL Filename Formula Showing the Wrong Workbook Path
Question details
The user needs to correct the output of the CELL("filename") formula, which incorrectly displays the path of a different open workbook instead of the current one.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Working with multiple open Excel workbooks and using the =CELL("filename") function to display the current file's path.
- Observed behavior
- The formula shows the path of the last active workbook rather than the one where the formula resides, failing to update automatically when switching between files.
Ensure your workbook has been saved at least once to your local drive or cloud storage, as the CELL("filename") formula will return an empty string if the file is unsaved.
Force a Manual Formula Recalculation
Manually refreshing the formula bar forces Excel to recalculate the CELL function for the specific active workbook.
Click on the specific cell in your worksheet that contains the =CELL("filename") formula.
Click into the formula bar at the top of the Excel window, or press the F2 key on your keyboard to edit the cell directly.
Press the Enter key. The filename path will immediately refresh to reflect the correct current workbook.

Anchor the Formula to a Specific Cell
Adding a cell reference to the formula prevents Excel from pulling the path of the last modified workbook.
Experience Reliable Formula Calculations with WPS Office
If you frequently encounter formula calculation glitches or workbook path errors in Microsoft Excel, consider switching to WPS Office. It is a highly compatible, lightweight, and free alternative that flawlessly handles complex spreadsheets and functions.

Frequently Asked Questions
Why does CELL("filename") return a blank value?
The CELL("filename") function requires the workbook to have a saved file path on your system. If you are working in a brand-new, unsaved workbook, the formula will return an empty string. Save the file first, then refresh the formula.
Does converting my file to XLSM fix formula errors?
Not automatically. While XLSM supports macros and is a more modern format than XLS, converting alone does not refresh static calculation states in Excel. You still need to manually recalculate or edit the cell to update the returned value.
Why does Excel calculate formulas from the wrong workbook?
When you omit the optional reference argument in certain functions like CELL, Excel defaults to the last cell that was changed across all open workbooks. Providing a specific cell reference anchors the calculation to the desired file.




