Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

How to insert file name or path into cell / header or footer in Excel?

Author Xiaoyang Last modified

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 good idea3

Insert current file name or path in header/footer with Header & Footer function


arrow blue right bubble 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.


arrow blue right bubble 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.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

After installing Kutools for Excel, please do as below:

1. Click Kutools Plus > Workbook Tools > Insert Workbook Information, see screenshot:

click Insert Workbook Information feature of kutools

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:

set options in the dialog box

3. Then click OK. If you insert the wotkbook information into a cell, you will get the result as follows:

insert the wotkbook information by kutools

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.


arrow blue right bubble 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:

click File Path, File Name or Sheet Name under the Design tab

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 path into the header
Insert the file name into the footer
Insert the file name into the footer

Best Office Productivity Tools

šŸ¤– Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

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.

Excel Word Outlook Tabs PowerPoint
  • 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