30 Advanced Excel Tips for 2026

Excel Champs / Excel Basics / How to Add a Header and Footer in Excel
By Puneet Gogia (Microsoft MVP)

How to Add a Header and Footer in Excel

30+ Advanced Excel Tips for 2026

No spam. Only Excel Stuff. God Promise. 😊

When you print your spreadsheet data, sometimes you need to display some basic information related to your spreadsheet, such as page numbers, the printed date, the workbook name, etc. For this, you use the Header and Footer feature of Excel.

You can use Excel’s predefined headers and footers or customize them based on your preference.

Steps to Insert a Header in Excel

  1. First, go to the “Insert” tab.
  2. After that, go to the “Text” group (or click the “Text” drop-down on a narrow ribbon) and then click the “Header & Footer” option.
    insert-tab
  3. Once you click on “Header & Footer”, Excel switches to Page Layout view and displays the header section of the current worksheet, where you can add the header elements.
    excel header
  4. Once you are done with the header, just click anywhere in the sheet to get out of the header section, and your header becomes active.
  1. First, go to the “Insert” tab.
  2. After that, go to the “Text” group (or click the “Text” drop-down on a narrow ribbon) and then click the “Header & Footer” option.
    text group
  3. Now, you will see the “Go to Footer” icon in the Navigation group on the ribbon; you just need to click on it.
    go-to-footer
  4. Once you click on the “Go to Footer” icon, Excel displays the footer section of the current worksheet, where you can add the footer elements.
    excel-footer
  5. Once you are done with the footer, just click anywhere in the sheet to get out of the footer section, and your footer becomes active.

In “Header and Footer”, you always get three boxes (left, center, and right) to enter the text, values, images, etc. for your header and footer. Based on which side you want to display your header and footer elements, you can enter the data in that box.

Steps to Insert Predefined Headers and Footers in Excel

Excel has several predefined “Header and Footer” elements that you can add to your document with just a click of the mouse.

  1. First, go to the “Insert” tab.
  2. After that, go to the “Text” group (or click the “Text” drop-down on a narrow ribbon) and then click the “Header & Footer” option.
    header-and-footer-option
  3. The moment you click the “Header & Footer” option, you will find the new “Header & Footer” tab with multiple predefined elements.
  4. Now, you can select any one of them that you want to use in your header.
    header-footer-elements
  5. For example, if you want to use the “Number of Pages” element, just click on it, and it will appear in the header of your worksheet.
    number-of-pages-element
  6. You can also select the predefined “Header and Footer” elements by clicking on the “Header” and “Footer” options.
  7. Once you click “Header” or “Footer”, it will show you a list of predefined elements to choose from.
    footer-predefined-list

To view what your header and footer look like after you select a predefined element, simply click anywhere in the sheet to get out of the header and footer section.

Excel has the option of formatting and customizing the font size, style, color, and effect for your “Header & Footer” based on your preference.

  1. First, go to the “Page Layout” tab and click on the Page Setup dialog box launcher (the small arrow at the bottom-right of the group).
    page-layout-tab
  2. After that, click on the “Header/Footer” tab, and you will get the “Custom Header” and “Custom Footer” buttons.
  3. Now click on the “Custom Header” or “Custom Footer” option, which you want to customize, change, or edit.
    custom-header-footer
  4. Now, select the text and click on the font icon (A) to open the Font dialog box, where you can change the font size, color, style, and effects for your “Header & Footer”.
    custom-header-footer-font
    custom-header-footer-font-options
  1. To hide the existing “Header & Footer” on the screen, go to the “View” tab and click the “Normal” icon. Note that this only hides them while you work; they are still printed.
    excel-view-tab
  2. You can also go back to Normal view by just clicking on the “Normal” icon on the status bar.
    normal-icon-status-bar

To really remove a header or footer, so it doesn’t print, open Page Layout ➜ Page Setup ➜ Header/Footer and select “(none)” in the Header and Footer drop-downs. Or, in Page Layout view, click in the header box and delete its text.

When you click an element like Page Number, Excel inserts a code in the box, which it replaces with the real value when you print. You can also type these codes yourself and mix them with text, like Page &[Page] of &[Pages]:

  • &[Page]: the page number.
  • &[Pages]: the total number of pages.
  • &[Date] and &[Time]: the date and time when you print.
  • &[File], &[Path] and &[Tab]: the workbook name, its folder path, and the sheet name.

On the Header & Footer tab, in the Options group, you can tick “Different First Page” (for example, no page number on a cover page), “Different Odd & Even Pages”, “Scale with Document” and “Align with Page Margins”.

And to add the same header or footer to several sheets at once, select those sheets first (hold Ctrl and click their tabs), then open Page Setup from the Page Layout tab and set the header or footer there. Ungroup the sheets when you are done.

In VBA, you use the PageSetup object of the sheet, where &P is the page number, &N the number of pages, &F the file name and &D the date. The following code adds the file name to the left header and “Page 1 of 5” style numbers to the center footer of every worksheet:

Sub add_header_footer()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws.PageSetup
.LeftHeader = "&F"
.CenterFooter = "Page &P of &N"
End With
Next ws
End Sub

Frequently Asked Questions

Why can’t I see the header in Normal view?

Headers and footers only show in Page Layout view and in Print Preview (Ctrl + P). They are still there in Normal view and print as usual.

How do I start page numbers from a different number?

Open Page Layout ➜ Page Setup ➜ Page tab and enter the number in “First page number”. The &[Page] code then starts from that number.

Can I add a logo to the header?

Yes. Click in a header box and click Picture on the Header & Footer tab. Excel inserts the &[Picture] code, and you can resize the image with Format Picture.

Puneet Gogia

Written by

Puneet Gogia

Microsoft MVP — Excel · Founder, Excel Champs

Twelve years of teaching Excel, and a decade before that using it as a data analyst. Every tutorial here is written from a file I actually built.

3M+ readers helped
1,000+ tutorials written
Since 2015 teaching Excel