This article was previously published under Q323225
For a Microsoft Excel for Windows version of this article, see 214084.
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
where HD is the name of your hard disk and filename is the name of your saved Excel workbook.
To display the full path and worksheet name of the current workbook, type the following formula as an array formula
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: