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 CTRL+SHIFT+ENTER.
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: