How to Print Page Numbers in Excel: Step-by-Step
In this article
To print page numbers in Excel, you add a header or footer with a page number code. Go to Page Layout > Page Setup (click the small arrow in the Page Setup group), open the Header/Footer tab, choose a preset that includes page numbers or click Custom Header / Custom Footer and insert the page number field. Then print or preview. This works in Excel for Microsoft 365, Excel 2019, 2021, and Excel for Mac; menu labels can differ slightly by version, device, or region.
What You'll Need
- Excel installed on Windows or Mac (the steps below cover both; where they differ, it is noted).
- A workbook with at least one worksheet you want to print.
- A printer or the ability to print to PDF for testing.
Step-by-Step
- Open the worksheet you want to print. Page numbers are set per worksheet, so if you have multiple sheets, you will need to repeat the header/footer setup for each one (or select multiple sheets first to apply the same settings).
- Go to Page Layout view or Page Setup. On Windows, click the Page Layout tab on the ribbon, then click the small arrow in the bottom-right corner of the Page Setup group. On Mac, go to File > Page Setup. The Page Setup dialog opens.
- Open the Header/Footer tab. In the Page Setup dialog, click the Header/Footer tab. You will see drop-down menus for Header and Footer with preset options.
- Choose a preset or go custom. The drop-down lists include options like "Page 1 of ?" and "Page 1". If one of those matches what you want, select it and skip to step 7. For more control (for example, adding text like "Confidential" or placing the number on the left), click Custom Header or Custom Footer.
- Insert the page number field. In the custom header/footer dialog, click inside the Left, Center, or Right section box, then click the Page Number button (it looks like a # sign). To show "Page X of Y", also click Number of Pages and type " of " between the two fields. You can type plain text around the fields.
- Format the text if needed. Select the text in the section box and use the formatting buttons (font, size, bold) in the dialog. Click OK to close the custom dialog, then OK again to close Page Setup.
- Check the print preview. Press Ctrl+P (Windows) or Command+P (Mac) to open the print preview. Look at the header or footer area on each page to confirm the page number appears. If it does not, return to Page Setup and verify the header/footer is set to the correct section and that the field was inserted, not just typed as "#".
- Adjust the starting page number if needed. In the Page Setup dialog, on the Page tab, you can set "First page number" to a value other than Auto. This is useful if your printed document is part of a larger packet.
- Print or save as PDF. Click Print. If you want to test without paper, choose Microsoft Print to PDF (Windows) or Save as PDF (Mac) as the printer.
Common Mistakes
- Typing "#" instead of inserting the field. A literal # will print as #, not as the page number. Always use the Page Number button in the custom header/footer dialog.
- Setting the header/footer on only one sheet. If you print the whole workbook, other sheets may lack page numbers. Select multiple sheet tabs (hold Ctrl or Command) before opening Page Setup to apply the same header/footer to all selected sheets.
- Expecting page numbers in Normal view. Headers and footers only appear in Page Layout view, Print Preview, or on the printed page. They are not visible in the normal grid.
- Forgetting that page numbers are based on printed pages, not rows. Excel numbers the pages it prints, so a long sheet may span several pages even if it looks like one screen.
- Using the wrong section. If you insert the page number in the left section but the header is set to center, you may not see it where expected. Check the alignment in the custom dialog.
Tips
- Use "Page &[Page] of &[Pages]" for a professional look. The &[Page] and &[Pages] codes are what Excel inserts when you click the buttons.
- To add the file name or date, use the corresponding buttons in the custom header/footer dialog.
- If you want different headers on the first page (for example, no page number on the cover), tick Different First Page on the Header/Footer tab and leave the first-page header/footer blank.
- For a quick visual check, switch to View > Page Layout; you can click the header or footer area directly and edit it there.
- Page numbers are saved with the workbook, so they persist when you reopen the file.
Troubleshooting
If page numbers do not appear when you print, work through these checks in order:
- Confirm the header/footer is applied to the correct sheet. Click the sheet tab, then reopen Page Setup > Header/Footer. If the drop-down shows "(none)", select a preset or set a custom one.
- Check print area and page breaks. If the print area is set to a small range, you may only get one page. Go to Page Layout > Print Area > Clear Print Area to reset, or adjust the print area to include all data.
- Look at the print preview, not the normal view. Press Ctrl+P and scroll through the preview pages. If the number is there in preview but not on paper, the printer may be cutting off the margin; reduce the header/footer margin in Page Setup > Margins.
- Update Excel if the dialog looks different. Menu labels can vary by version. If you cannot find a button, use the search box in Excel (Alt+Q on Windows) and type "header footer" to jump to the setting.
- Try a different printer or PDF. If the page number prints as a blank space, test with Microsoft Print to PDF to rule out a printer driver issue.
Frequently Asked Questions
Can I add page numbers to only one worksheet?
Yes. Page setup is per worksheet. Select the sheet, set the header/footer, and other sheets remain unchanged unless you select them too.
How do I start page numbering at a number other than 1?
In Page Setup, go to the Page tab and set "First page number" to your desired start value. This affects the printed page numbers for that sheet.
Why does my header show "&[Page]" instead of a number?
That means the field was typed as text rather than inserted. Delete it and use the Page Number button in the custom header/footer dialog to insert the real field.
Can I put page numbers in the middle of the page?
No. Excel only supports headers and footers at the top and bottom margins. For a page number in the body, you would need to use a text box, but it will not update automatically per page.
Do page numbers appear when I print to PDF?
Yes, if the header/footer is set, the page numbers will be included in the PDF output, just as with a physical printer.
How do I remove page numbers?
Open Page Setup > Header/Footer and set the header and footer drop-downs to "(none)", or open the custom dialog and delete the page number field.