To create a "Page 1 of 2" style numbering system in Excel, you do not use a cell formula, but rather the Header & Footer tools. Because Excel is a grid of cells rather than a paginated document like Word, page numbers are dynamic properties of the print layout and cannot be calculated using standard worksheet formulas like SUM or IF. By using the Insert Header & Footer menu, you can tell Excel to automatically track the current page number and the total page count for every sheet you print.

What You'll Need

  • A computer with Microsoft Excel installed (Windows or macOS).
  • A dataset or spreadsheet that spans more than one printed page.
  • Access to the Print Preview or Page Layout view to verify the results.

Step-by-Step

  1. Switch to Page Layout View: Open your Excel workbook. By default, you are likely in "Normal" view. Go to the View tab on the top ribbon and select Page Layout. This view changes the spreadsheet from a continuous grid to a representation of how the pages will actually look when printed, revealing the header and footer areas.
  2. Access the Header or Footer: Hover your mouse over the top of the page to see the Add header section, or scroll to the bottom of the page to see the Add footer section. Click into one of the three available boxes (left, center, or right). Most professional documents place page numbering in the center or right-hand box.
  3. Open the Header & Footer Tools: Once you click inside a header or footer box, a new contextual tab appears in the ribbon called Header & Footer. Click this tab to reveal the specific tools needed for page numbering.
  4. Insert the Current Page Number: In the Header & Footer tab, locate the Header & Footer Elements group. Click the button labeled Page Number. Excel will not put a number there immediately; instead, it will insert a code that looks like &[Page]. This is a placeholder that tells Excel to calculate the current page number during the printing process.
  5. Add the "of" Text: Place your cursor immediately after the &[Page] code. Type a space, the word "of", and another space. Your box should now look like &[Page] of .
  6. Insert the Total Page Count: With your cursor still in the box, go back to the Header & Footer ribbon and click the button labeled Number of Pages. Excel will insert a second code, &[Pages]. The complete string in your header or footer box should now read &[Page] of &[Pages].
  7. Exit the Header/Footer Area: Click any cell within the main body of the worksheet to exit the header/footer editing mode. You will now see the actual numbers (e.g., "Page 1 of 2") instead of the codes.
  8. Verify via Print Preview: To ensure everything is aligned correctly, go to File > Print. The print preview window will show exactly how the "Page 1 of X" formula renders across all pages of your document.

Common Mistakes

One of the most frequent mistakes users make is attempting to type the page number manually into a cell. If you type "Page 1 of 2" into cell A1, that text will appear on every single page in that exact position, regardless of whether it is actually the first or second page. Because Excel cells are static, they cannot detect which physical page they have landed on during the print spooling process.

Another common error is confusing the Page Number button with the Number of Pages button. The &[Page] code is for the current page, while &[Pages] (with an 's') is for the total count. If you use the same button twice, your footer will say "1 of 1" on the first page and "2 of 2" on the second page, which defeats the purpose of the total count.

Users also frequently forget to check their Print Area. If you have a specific print area defined, Excel will only count the pages within that area. If you add data outside the print area, the "Total Pages" count will not increase, which can lead to confusion when the printed document is shorter than expected.

Tips

To make your page numbering look more professional, you can wrap the codes in additional text. For example, instead of just &[Page] of &[Pages], you can type Sheet 1 - Page &[Page] of &[Pages]. This is particularly helpful when you are printing multiple tabs from a workbook and need to keep track of which sheet the page belongs to.

If you want the first page to have a different look (for example, no page number on a cover page), use the Different First Page checkbox located in the Header & Footer ribbon. When this is checked, Excel provides a separate header and footer for page one, allowing you to leave it blank while starting the "Page 1 of X" sequence on the second physical page.

For very large datasets, consider using Page Break Preview (found under the View tab). This allows you to manually drag the blue page borders. As you move these borders, the total page count (the "X" in "Page 1 of X") will update automatically in real-time, allowing you to optimize your layout to fit the data into a specific number of pages.

Troubleshooting

The page numbers are showing as codes (e.g., &[Page]) instead of numbers: This usually happens because you are looking at the header/footer while the cursor is still active inside the box. Click any cell in the main spreadsheet area to "lock" the header and see the rendered numbers. If they still appear as codes in the Print Preview, ensure you are using a standard version of Excel and not a third-party viewer that doesn't support dynamic headers.

The total page count is incorrect: First, check your Page Break Preview to see if Excel has automatically created extra pages due to a single stray character or a wide column. If a column is slightly too wide for the page, Excel will push that one column to a new page, increasing your total count. Adjust your column widths or change the orientation to Landscape (under the Page Layout tab) to see if the count corrects itself.

The footer is not appearing at all: Ensure that your Margins are not set too narrow. If the bottom margin is set to 0, the footer may be pushed off the printable area of the physical paper. Go to Page Layout > Margins > Custom Margins and ensure there is enough space allocated for the footer (usually at least 0.3 inches).

The numbers are not updating when I add data: Page numbers in Excel are calculated at the moment of printing or when switching to Page Layout view. If you have added hundreds of rows, try switching back to Normal view and then back to Page Layout view to force Excel to recalculate the total page count.

Frequently Asked Questions

Can I use a formula like =PAGE() in a cell?

No, Excel does not have a built-in cell function to return the current page number. Page numbering is strictly a feature of the Header and Footer layers.

How do I start the page numbering from page 2?

Go to the Page Layout tab, click the small arrow in the corner of the Page Setup group, and under the Page tab, change the "First page number" from "Auto" to the number you wish to start with.

Can I put page numbers in the middle of the page?

Not dynamically. You can only place automatic page numbers in the Header or Footer. If you need a page number in the middle of the sheet, you would have to type it manually, but it will not update automatically as you add data.

Does this work on Excel for the Web?

Yes, but the interface is different. You generally have to go to File > Print to access the print settings and header/footer options, as the web version does not always show the Page Layout view in the same way the desktop app does.

How do I remove the page numbers?

Return to the Page Layout view, click into the header or footer box where the numbers are located, highlight the &[Page] of &[Pages] text, and press Delete.