How to display the file name of a worksheet without using a macro in Excel for Mac

Article translations Article translations
Article ID: 323225 - View products that this article applies to.
This article was previously published under Q323225
For a Microsoft Excel for Windows version of this article, see 214084.
Expand all | Collapse all

SUMMARY

This article describes how to create a formula that displays the file name of a worksheet in a cell.

For example, for a file with the path HD:Users:local:Desktop, the formula returns
HD:Users:local:Desktop:(filename)Sheet1
where HD is the name of your hard disk and filename is the name of your saved Excel workbook.

MORE INFORMATION

To display the full path and worksheet name of the current workbook, type the following formula as an array formula
=Cell("filename")
where "filename" is literally the word "filename", in quotation marks.

NOTE: You must input this formula as an array formula. To input a formula as an array formula, press COMMAND+RETURN.

The formula returns the full path and worksheet name of the current workbook as long as the workbook has been saved at least once. If you use this formula in an unsaved workbook, the formula cell remains blank until you save the workbook.

To return the name of the workbook only, use the following formula:
=MID(CELL("filename"),SEARCH("[",CELL("filename"))+1,SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)
NOTE: You do not have to input this formula as an array formula.

If you use this formula in an unsaved workbook, you receive the following error:
#VALUE!
When you save the workbook, the file name replaces the error.

Properties

Article ID: 323225 - Last Review: October 6, 2011 - Revision: 3.0
APPLIES TO
  • Microsoft Excel 2004 for Mac
  • Microsoft Excel X for Mac
  • Microsoft Excel 2001 for Mac
  • Microsoft Excel 98 for Macintosh
Keywords: 
dftsdahomeportal kbinfo KB323225

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com