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

Moving Through a Table in a Macro

Do you need to step through a table, cell by cell, in a macro? It's easy to do using the Move method, as described in ...

Discover More

Protecting Print Settings

Need to have your print settings always be a certain way? Tired of resetting the settings after others use the workbook ...

Discover More

Using AutoCorrect

The AutoCorrect feature in Excel is a great tool for quickly entering information. Here's an explanation of the feature ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Roman Numerals for Page Numbers

Yes, Excel can work with Roman numerals, and it even provides a worksheet function that converts to them. How you use ...

Discover More

Putting Headers and Footers on Multiple Worksheets

You can easily create headers and footers for multiple worksheets by working with a selection set of the worksheets you ...

Discover More

Creating Long Page Footers

Ever wish that you could create nice, long footers that appear at the bottom of each page when you print your worksheet? ...

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 five more than 8?

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.