Insert file path / name into cell / header or footer in Excel - Full guide
Inserting the file path or file name into a cell, header, or footer in an Excel workbook can be very useful for several reasons, particularly in professional, collaborative, or complex document management scenarios. This guide will help you with each of these tasks, ensuring that you can easily reference file details within your Excel workbooks.
- Insert current file path or file name in cell
- Insert current file path or file name in header or footer
- Insert current file path or file name or other file information in cell, header or footer
- Insert current file path in Excel ribbon
Insert current file path or file name in cell
To display the current file path, file name, file name & current sheet… in a cell, you can use the following formulas:
Item | Formula | Result |
File path only: | =LEFT(CELL("filename"),FIND("[",CELL("filename"))-1) | C:\Users\skyyang\Desktop\ |
File name only: | =MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1) | Excel Data table .xlsx |
File name & current sheet: | =RIGHT(CELL("filename"),LEN(CELL("filename"))- MAX(IF(NOT(ISERR(SEARCH("\",CELL("filename"), ROW(1:255)))),SEARCH("\",CELL("filename"),ROW(1:255))))) Array formula: press Ctrl + Shift + Enter keys together |
[Excel Data table .xlsx]Sheet2 |
File path & File name: | =SUBSTITUTE(LEFT(CELL("filename"), FIND("]", CELL("filename"))-1), "[", "") | C:\Users\skyyang\Desktop\Excel Data table .xlsx |
File path & File name & current sheet: | =CELL("filename") | C:\Users\skyyang\Desktop\[Excel Data table .xlsx]Sheet2 |
Insert current file path or file name in header or footer
If you need to insert file names, file paths, and other document-related information into headers or footers in Excel, here’s a detailed guide on how to incorporate these elements into your Excel documents efficiently.
- Open the Header or Footer tab by clicking Insert > Header & Footer, see screenshot:
- Decide where to insert the information. You can insert details into the header or footer. Excel divides these into three sections: left, center, or right. Click one section, under the Header & Footer tab, choose File Path, File Name or Sheet Name that you need to insert. See screenshot:
- Then click any cell to exit the Header & Footer mode, the file path or name or sheet name will be displayed as following screenshot shown:
Insert current file path or file name or other file information in cell, header or footer
Enhance your Excel workflow and document management efficiency with Kutools for Excel's Insert Workbook Information feature. This powerful tool allows you to effortlessly insert vital information such as the current file path, file name, current date and time, user name and other essential workbook details directly into your cells, headers, or footers.
After installing Kutools for Excel, click Kutools Plus > Workbook > Insert Workbook Information, in the 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. At last, click OK button. See screenshot:
Insert current file path in Excel ribbon
Having the file path readily available on the Ribbon can save you time, especially when you need to access the file location quickly for saving, sharing, or organizing purposes. This section will talk about how to add file path into the Excel ribbon.
1. Open one Excel file, and then click File > Options, in the Excel Options dialog box:
- 1) Click Quick Access Toolbar option from the left pane;
- 2) Then choose All Commands from the Choose commands from drop down list;
- 3) Scroll to select Document Location from the list box;
- 4) And then click Add > > button to add the Document Location to the right pane;
- 5) At last, click OK.
2. Now, the full path of the current file will display on the left of the ribbon.
- Each time you open an Excel file, the file path will always be displayed on the Ribbon.
- If you are using Excel 365 or Excel 2021 and the Document Location option is not available in the Excel Options dialog box, you should use the Address [Document Location] option instead, as shown in the screenshot:
Implementing these features not only enhances work efficiency but also improves the readability and manageability of documents, especially when dealing with a large number of files and data, quickly locating the source and status of files becomes particularly important. If you're interested in exploring more Excel tips and tricks, our website offers thousands of tutorials, please click here to access them. Thank you for reading, and we look forward to providing you with more helpful information in the future!
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!