Page Numbers in Excel: How to Add and Format Them
In this article
To put page numbers in Excel, go to the Insert tab, click on Header & Footer, and select Page Number from the Header & Footer Design tab. This process adds dynamic numbering to your worksheets, ensuring that when you print or save the file as a PDF, each page is sequentially numbered, which is essential for organizing large datasets or long reports. Because Excel is a grid-based application rather than a word processor, page numbers are not visible in the standard Normal view; they only appear in Page Layout view or on the final printed document.
What You'll Need
- A computer with Microsoft Excel installed (Windows or macOS).
- A dataset or worksheet that spans more than one printed page.
- Knowledge of your desired print area to ensure page numbers appear in the correct locations.
Step-by-Step
- Switch to Page Layout View: Open your Excel workbook. By default, you are in Normal view, where headers and footers are hidden. Go to the View tab on the top ribbon and select Page Layout. Alternatively, click the middle icon (Page Layout) in the small view shortcut menu located at the bottom-right corner of the Excel window. Note that menu labels may differ slightly depending on your version of Excel or region.
- Access the Header or Footer Area: In Page Layout view, you will see three boxes at the top of the page (Header) and three boxes at the bottom (Footer). Click inside any of these boxes—left, center, or right—depending on where you want the page number to appear. Once you click, the Header & Footer Design tab will automatically appear in the ribbon.
- Insert the Page Number Code: With your cursor blinking inside the header or footer box, look at the Header & Footer Design tab. In the Header & Footer Elements group, click the Page Number button. Excel will insert a code that looks like
&[Page]. Do not type this manually; using the button ensures the number updates automatically as you add or remove data. - Add "Page X of Y" Formatting: If you want the document to show the total number of pages (e.g., "Page 1 of 10"), first type the word "Page " followed by a space. Then, click the Page Number button. Next, type a space, the word "of", and another space. Finally, click the Number of Pages button in the ribbon. The resulting code should look like
Page &[Page] of &[Pages]. - Finalize and Exit: Click anywhere inside the main spreadsheet cells to exit the header or footer editing mode. You will now see the actual page numbers (e.g., 1, 2, 3) instead of the codes.
- Verify via Print Preview: To ensure the numbers are positioned correctly, go to File > Print. The Print Preview pane on the right will show exactly how the page numbers will appear on the physical paper.
Common Mistakes
One of the most frequent errors is attempting to type the page number manually into a cell. If you type "Page 1" into cell A1, every single printed page will say "Page 1" because cell A1 is static. Page numbers must be placed in the Header or Footer sections to be dynamic.
Another common mistake is forgetting to switch views. Users often report that they followed the steps but "cannot see the page numbers." This happens because they are still in Normal view. Remember that headers and footers are invisible in the standard grid view to maximize workspace; you must be in Page Layout view or Print Preview to see them.
Some users also fail to set their Print Area before adding page numbers. If your data is sprawling across the sheet without defined boundaries, Excel may create dozens of unnecessary pages with page numbers on them, wasting paper and making the document look unprofessional. Always use Page Layout > Print Area > Set Print Area before finalizing your numbering.
Tips
To start numbering from a specific page (for example, if you have a cover page that should not be numbered), go to the Page Layout tab. In the Page Setup group, click the small arrow (dialogue box launcher) in the bottom-right corner. In the Page window that opens, look for the "First page number" box at the bottom. Change "Auto" to a specific number. If you want the second page to be "Page 1", you can set the first page to 0, though this is typically used for advanced layout needs.
For professional reports, consider adding the file name or the current date alongside the page number. In the Header & Footer Design tab, you can use the "File Name" or "Current Date" buttons. For example, a footer reading "Quarterly Report - 2026-12-04 - Page 1 of 5" provides much better context for anyone reading a physical printout.
If you have multiple sheets in one workbook, you can apply the same page numbering to all of them simultaneously. Right-click on the sheet tabs at the bottom of the screen and choose "Select All Sheets." Now, any header or footer change you make to one sheet will be mirrored across every sheet in the workbook.
Troubleshooting
The page numbers are not appearing in Print Preview: First, check if you accidentally placed the page number in a section that is being cut off by your printer's margins. Go to Page Layout > Margins and ensure you have at least 0.5 inches of space. If the margins are too narrow, the printer may ignore the header or footer entirely.
The page numbers are skipping or jumping: This usually happens because of "Manual Page Breaks." If you have inserted manual breaks (Page Layout > Breaks > Insert Page Break), Excel will force a new page regardless of how much data is on the current one. Check your layout and remove unnecessary breaks by selecting Page Layout > Breaks > Reset All Page Breaks.
The &[Page] code is visible instead of the number: This occurs if you are editing the header/footer box. The code is only replaced by the number once you click back into the worksheet cells. If it still shows as a code in Print Preview, ensure you used the ribbon buttons and did not simply type the symbols manually.
Page numbers are appearing on every page as "1": This is a sign that you have entered the number as text in a cell or as a static text string in the header. Delete the text and use the "Page Number" button from the Header & Footer Design tab to ensure the dynamic variable is used.
Frequently Asked Questions
Can I put page numbers in the middle of the page?
No, Excel does not support placing page numbers within the actual cell grid. Page numbers are strictly limited to the Header and Footer sections of the page.
How do I remove page numbers from the first page?
In the Header & Footer Design tab, check the box that says "Different First Page." This allows you to leave the header and footer of the first page blank while keeping numbering on all subsequent pages.
Do page numbers work in Excel Online (Web version)?
Yes, but the process is different. You usually go to Page Layout > Page Setup or use the Print settings menu to enable headers and footers, as the Web version does not have a "Page Layout View" identical to the desktop app.
Can I change the font or color of the page numbers?
Yes. While the cursor is inside the header or footer box, highlight the &[Page] code. You can then go to the Home tab and change the font, size, bolding, or color just as you would with any other text in Excel.
Will page numbers be visible if I save the file as a PDF?
Yes. When you export or save a workbook as a PDF, Excel treats it as a print job, meaning all headers, footers, and page numbers will be rendered exactly as they appear in the Print Preview.