How to insert file name or path into cell / header or footer in Excel?
Supposing you want to insert the file name or file path into Excel cell, header or footer, how could you quickly do this operation?
Insert current file name or path in a cell with Formula
Insert current file name or path in cell / header or footer with Kutools for Excel
Insert current file name or path in header/footer with Header & Footer function
Insert current file name or path in a cell with Formula
With the following formulas, you can quickly insert file name or path or sheetname in a speicfied cell.
Item | Formula | Example |
Filename only | =MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1) | products features.xlsx |
Filepath only | =LEFT(CELL("filename",A1),FIND("[",CELL("filename",A1),1)-1) | C:\Users\dt\Desktop\New folder\ |
Active sheetname only | =RIGHT(CELL("filename"),LEN(CELL("filename"))-FIND("]",CELL("filename"),1)) | Sheet7 |
Current filename, filepath and active sheetname | =CELL("filename") | C:\Users\dt\Desktop\New folder\[products features.xlsx]Sheet7 |
Notes:
1. Copy any above formula that you need to a specified cell, and you will get the result you need.
2. The opend workbook must have been saved.
Insert current file name or path in cell / header or footer with Kutools for Excel
Kutools for Excelās Insert Workbook Information is a mutifunctional tool, it can help you insert worksheet name, workbook name, workbook path or workbook path & name into the Excel cells, header or footer quickly and conveniently.
After installing Kutools for Excel, please do as below:
1. Click Kutools Plus > Workbook Tools > Insert Workbook Information, see screenshot:
2. In the Insert Workbook Information dialog box, choose the workbook information you want to insert from left pane, and then select the place where you want to insert the information at. See screenshot:
3. Then click OK. If you insert the wotkbook information into a cell, you will get the result as follows:
If you insert the workbook information into the header or footer, you can choose the location where you want to insert the information into, Left, Right or Center. And you can preview the header or footer from View > Page Layout.
Insert current file name or path in header/footer with Header & Footer function
If you want to insert the filename or filepath into the wotksheet header or footer, you can use the Header & Footer function.
1. On the Ribbon, click Insert > Header & Footer.
2. There will be three editing box in the Header or Footer section, click left, center or ringht box that you want to insert the filename or path. Then under the Design tab, click File Path, File Name or Sheet Name that you need to insert. See screenshot:
Then click any cell, and you can see the file path or name or sheet name has been inserted into the header ot footer. See screenshots:
Insert the file path into the header |
![]() |
Insert the file name into the footer |
![]() |
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.





- All-in-one suite ā Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license ā set up in minutes (MSI-ready)
- Works better together ā streamlined productivity across Office apps
- 30-day full-featured trial ā no registration, no credit card
- Best value ā save vs buying individual add-in