Using X of Y in a Page Footer

Written by Allen Wyatt (last updated May 18, 2024)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021


Terry remembers that "back in the day" he could add a page footer to a worksheet such as "Page X of Y," where X is the current page and Y is the total number of pages. He can no longer remember how to add such a footer, however.

Actually, there are two ways you can add such a footer to your worksheets. The traditional method (which is probably what Terry is seeking) is to follow these steps:

  1. Click the Page Layout tab of the ribbon.
  2. Click the small icon at the bottom-right of the Page Setup group. Excel displays the Page Setup dialog box.
  3. Make sure the Header/Footer tab is displayed. (See Figure 1.)
  4. Figure 1. The Header/Footer tab of the Page Setup dialog box.

  5. Click the Custom Footer button. Excel displays the Footer dialog box. (See Figure 2.)
  6. Figure 2. The Footer dialog box.

  7. Place the insertion point in whichever section of the footer you want used for the page information—left, center, or right.
  8. Type Page followed by a space.
  9. Click the Page Number tool. The code "&[Page]" appears in the footer.
  10. Type a space, the word of, and another space.
  11. Click the Pages tool. The section now contains "Page &[Page] of &[Pages]."
  12. Close all the dialog boxes by clicking OK, as necessary.

It should be noted that you don't have to really use the page number tool or the pages tool in putting the footer together. You could just as easily have typed the proper code ("Page &[Page] of &[Pages]") in whatever footer section you wanted used.

The second method of adding such a footer is to follow these steps:

  1. Display the Insert tab of the ribbon.
  2. Click the Header & Footer tool, in the Text group. Excel immediately switches to Page Layout view, displays the Header & Footer tab of the ribbon, and positions the insertion point in the center section of the header.
  3. Near the left end of the ribbon, click the Footer tool. Excel displays various footer options.
  4. Choose the "Page 1 of ?" option. Excel adds the proper code to the center section of the footer and hides the Header & Footer tab of the ribbon.
  5. Display the View tab of the ribbon.
  6. Click the Normal tool. Your worksheet is returned to a normal view.

It doesn't really matter which of the techniques you use to add the desired footer. Both of them place the exact same code into the footer.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13925) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, Excel in Microsoft 365, and 2021.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Determining if a Text Selection Exists

Macros are often designed to be run on just a selected portion of a document. It is a good idea to make sure that the ...

Discover More

Handling Leading Zeros in CSV Files

When dealing with files containing comma-separated values, you want to make sure that what gets imported into Excel ...

Discover More

Borders Disappear on Shaded Table Rows

When creating a table, it is possible that adding row or cell shading can affect how cell borders are displayed. This ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Putting Cell Contents in Footers

Referencing information between cells in a worksheet is a piece of cake using some elemental formulas. You cannot, ...

Discover More

Changing Section Headers

Add subtotals to a worksheet and you can instruct Excel to start each new subtotal section on a new printed page. You may ...

Discover More

Adding Last-Row Data to a Page Footer

If you want to modify information that appears in the footer of a worksheet printout, on a page-by-page basis, you can ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two more than 7?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.