Excel Header and Footer: How to Add, Edit, and Remove Them
Learn how to add an Excel header and footer, insert page numbers, dates and file names, set different first or odd/even pages, and remove headers cleanly.
To add a header or footer in Excel, select the worksheet, go to Insert > Header & Footer, and type into the left, center or right box at the top (header) or bottom (footer) of the page. Excel switches to Page Layout view while you do this, and you can click anywhere in the sheet to finish or press Esc to discard your changes.
That covers the basic job. The rest of this guide walks through page numbers and other automatic fields, special layouts like a different first page, applying headers to several sheets, removing them, and the limits you’ll hit in Excel for the web. Steps are based on Microsoft’s support documentation for the desktop app as of November 2026; menu labels can shift slightly between versions.
Add a header or footer in Excel desktop
- Click the worksheet you want to change.
- Go to Insert > Header & Footer. Excel opens the sheet in Page Layout view and puts your cursor in the header area.
- Click the left, center or right section and type your text.
- To work on the footer instead, scroll to the bottom of the page and click into the footer sections.
- Click any cell in the worksheet to close the header/footer area, or press Esc to close it without keeping the changes.
One thing that trips people up: headers and footers only show in Page Layout view and on printed pages. If you go back to Normal view, they seem to disappear. They’re still there; check File > Print to confirm.
Use the Page Setup dialog instead
You can also do everything through Page Setup (Page Layout tab, then the small launcher arrow in the Page Setup group), on the Header/Footer tab. Microsoft notes that this dialog is the only route for chart sheets and charts, because they don’t have a Page Layout view. It’s also handy when you want to see all options in one place.
Insert page numbers, dates and file names
Typing “Page 3” by hand would print “Page 3” on every page. For anything that should update automatically, use the buttons on the Header & Footer tab (Page Number, Number of Pages, Current Date, File Name, Sheet Name, and so on). Each button inserts a field code.
There are also pre-defined headers and footers in the Header and Footer drop-downs, such as “Page 1 of ?”. Be aware that, per Microsoft, choosing a pre-defined option overwrites whatever header or footer you already had.
Common header and footer codes
If you prefer typing, these are the codes Excel inserts (as listed by Better Solutions and other references):
| Code | What it prints |
|---|---|
&[Page] | Current page number |
&[Pages] | Total number of pages |
&[Date] | Current date |
&[Time] | Current time |
&[File] | Workbook file name |
&[Path]&[File] | Full file path and name |
&[Tab] | Worksheet (tab) name |
&[Picture] | An inserted image |
A typical footer is Page &[Page] of &[Pages], which prints “Page 2 of 7”. Older Excel documentation also shows short codes such as &P and &N; the bracketed forms above are what current versions display.
Because the ampersand starts every code, you need to double it to print a literal one. Type Sales && Marketing to get “Sales & Marketing”.
Mind the length limit
Header and footer text is capped at about 255 characters per header or footer, and the hidden codes count toward that total. Sources phrase the rule slightly differently (some say “255 or fewer”, others “less than 256 including control characters”), but they describe the same limit. If you need a long legal notice in a footer, TechRepublic describes a workaround: put the text in a picture and insert it with the Picture button.
Different first page, odd/even pages and other options
The Options group on the Header & Footer tab, and the bottom of the Header/Footer tab in Page Setup, have four checkboxes. Microsoft’s Page Setup reference explains them:
| Option | What it does | Default |
|---|---|---|
| Different first page | Gives page 1 its own header/footer, or none at all, which is useful for cover pages | Off |
| Different odd and even pages | Lets left and right pages carry different headers/footers, which helps with bound or double-sided printouts | Off |
| Scale with document | Header/footer text resizes when you scale the worksheet to fit the page | On |
| Align with page margins | Lines header/footer edges up with the left and right margins instead of the paper edge | On |
When you turn on “Different first page” or “Different odd and even pages”, the Custom Header and Custom Footer dialogs gain extra tabs (First Page, Odd Page, Even Page) so you can fill each one separately.
If your header text overlaps the data, the problem is usually the margins. Increase the top or bottom page margin, or reduce the header/footer margin, under Page Layout > Margins > Custom Margins.
Apply headers to several sheets at once
- Hold Ctrl and click each sheet tab you want to include.
- Add the header or footer as usual. It’s applied to every selected sheet.
- When you’re done, click a single sheet tab outside the selection (or right-click a tab and ungroup) so the sheets are no longer grouped.
Step 3 matters. While sheets are grouped, any edit you make to cells also lands on every grouped sheet, which is easy to miss.
Remove a header or footer
To clear text from one section, open the header in Page Layout view, select the text and delete it.
To remove everything at once, Microsoft recommends:
- Open Page Layout > Page Setup (the launcher arrow) and go to the Header/Footer tab.
- In the Header box, choose (none). Do the same in the Footer box if needed.
- Click OK.
Group the sheets first (see above) if you want to strip headers from several sheets in one go.
Headers and footers in Excel for the web
This is where many people get stuck. As of November 2026, Microsoft Support states that editing headers and footers isn’t currently possible in Excel for the web, and that you can’t insert page numbers there either. Headers that already exist in a file are kept, but to add or change them you need the desktop app:
- In Excel for the web, choose Editing > Open in Desktop App.
- Make your header and footer changes in the desktop version.
- Save; the file syncs back to OneDrive or SharePoint.
Microsoft also recommends using Excel’s own Print command rather than your browser’s print option when printing from the web app. Microsoft updates Excel for the web regularly, so check the Print a worksheet or workbook page if you’re unsure whether this has changed.
Quick troubleshooting
- Header not visible: You’re probably in Normal view. Switch to View > Page Layout or open Print Preview.
- Header disappeared after choosing a preset: Pre-defined options replace existing content. Press Ctrl+Z to undo.
- Text too small on a scaled printout: Turn off “Scale with document” so the header keeps its own font size.
Free apps worth trying
SponsoredSponsored links. Installing through them can earn us a commission, at no cost to you. Apps are free to download; some offer optional in-app purchases.
Frequently asked questions
Why can't I see my header or footer in Excel? +
Headers and footers only appear in Page Layout view, in Print Preview and on printed pages. In Normal view they are hidden, so switch to View > Page Layout or open File > Print to check them.
Can I edit headers and footers in Excel for the web? +
According to Microsoft Support, editing headers and footers isn't currently possible in Excel for the web. Use Editing > Open in Desktop App to make the change in the desktop version, then save the file back.
How do I type an ampersand (&) in an Excel header? +
Excel uses the ampersand to start its field codes, so type it twice. For example, enter Products && Services to print Products & Services.
How do I put the same header on every sheet in a workbook? +
Select all the sheets first by Ctrl+clicking their tabs, then add the header. Remember to ungroup the sheets afterwards so later edits don't hit every sheet.
Sources
- Headers and footers in a worksheet - Microsoft Support (support.microsoft.com)
- Page Setup - Microsoft Support (support.microsoft.com)
- Print a worksheet or workbook - Microsoft Support (support.microsoft.com)
- Header and Footer Codes - Better Solutions (bettersolutions.com)
- 10 steps to beating Excel's character limit for headers and footers - TechRepublic (techrepublic.com)