In Excel: go to Insert ▸ Text ▸ Header & Footer — Excel switches to Page Layout view with three click-to-type boxes at the top and bottom of the page.
Choose Insert ▸ Text ▸ Header & Footer, or click View ▸ Page Layout and then the header area directly.
Click the left, centre or right box and type your text.
Use the Header & Footer tab buttons for Page Number, Number of Pages, Current Date, File Path, File Name or Sheet Name rather than typing them by hand.
Switch between header and footer with the Go to Header / Go to Footer buttons on that tab.
Tick Different First Page or Different Odd & Even Pages on the same tab when a cover page or a bound document needs it.
Click any cell and return to View ▸ Normal when you are done; use File ▸ Print to check the result.
What this does
A header or footer is print chrome: text that repeats at the top or bottom of every printed page and is invisible in Normal view. Each has a left, centre and right box, and the Header & Footer tab that appears while you edit supplies buttons for page number, page count, date, time, file path, file name and sheet name — these insert codes such as &[Page] that stay correct as the document grows. This is separate from repeating a *data* header row on each printed page, which is Page Layout ▸ Print Titles ▸ Rows to repeat at top. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. For “changing header in excel”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected header change, and only then apply the same setup to the full sheet. When this is a ribbon command, the selection matters more than the button: confirm the range, apply the command, then spot-check the output before saving. That is what makes a workspace setting that makes a big sheet comfortable to navigate useful in real work: repeatable, auditable, and not dependent on memory or luck.
A worked example
For a report that should show the sheet name on the left and "Page 2 of 7" on the right: Insert ▸ Header & Footer, click the left header box and press the Sheet Name button; click the right footer box, type "Page ", press Page Number, type " of ", press Number of Pages. The footer code reads Page &[Page] of &[Pages] and prints correctly on every page. Anything that leaves the screen as paper or PDF needs to say where it came from and which page you are holding — sheet name, date and "page 3 of 9" are what makes a printout usable. If there is any chance you will reuse this, drop it into a small template tab right now: a labelled input area on the left and the formula beside it, checked once against the tool above. Next time the same question comes up, the answer is a single paste away instead of a rebuild from memory.
In Google Sheets
Google Sheets handles this almost identically to Excel. The formula syntax above is the same, and the menu lives under a slightly different label rather than a ribbon tab. Use the platform toggle at the top of the page to switch every keyboard shortcut between Windows and Mac, and expect at most cosmetic differences in naming. Keep this page bookmarked for the next time the same question comes up. Better still, rebuild the example once in your own sheet — doing it yourself, with the tool above to check against, is what turns a copied formula into a technique you own. The short version of “changing header in excel”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.
Common mistakes
- Expecting the header to show in Normal view — it only appears in Page Layout view and in the print preview.
- Typing "Page 1" literally instead of using the Page Number button, so every page prints as page 1.
- Confusing this with freezing or repeating the top data row; that is Page Layout ▸ Print Titles ▸ Rows to repeat at top.
- Setting the header on one sheet and assuming it applied to the workbook — select all sheet tabs first if you want it everywhere.
- Pasting a large logo into the header without scaling it, which pushes the print area down the page.
Frequently asked questions
How do I add a header in Excel?
Insert ▸ Text ▸ Header & Footer. Excel switches to Page Layout view and gives you three boxes at the top of the page — click one and type.
Why can I not see my header?
Headers and footers only render in Page Layout view and in print previews, never in Normal view. Use View ▸ Page Layout to see them on screen.
How do I put the file name in the footer?
Click into the footer box, then press File Name on the Header & Footer tab. It inserts the &[File] code, which stays correct if the workbook is renamed.
How do I repeat my column headings on every printed page?
That is a different feature: Page Layout ▸ Print Titles ▸ Rows to repeat at top, then select the heading row. Headers and footers cannot pull cell content.