Getting a Proper Total Page Count

by Allen Wyatt
(last updated October 5, 2019)

1

Melissa has a document that begins with a title page. She wants the pages numbered beginning with 1, but that is actually the second page of the document. (The title page isn't counted in the page count.) She got the page numbering to start correctly for her first page, but her footer now says, "Page 1 of 80," "Page 2 of 80," etc. It should only show 79 pages, again because of the title page. Melissa wonders how she can get the total page count, as shown in the footer, to be correct.

The type of page numbers that Melissa is working with are generally called "X of Y" page numbers. The X represents the current page numbers, while Y represents the total. You generally construct this type of page number in one of two ways. First, you can create your own page numbers in this way by using field codes. Assuming you already know how to add field codes to your document, the finished code would look something like this:

Page { PAGE } of { NUMPAGES }

Once collapsed, the first field code displays the current page number and the second displays the total number of pages in the document. This brings us to the second way to insert the "X of Y" page numbers—using the pre-defined page number formats in Word.

You insert these by using the Page Number tool, which can appear on various ribbon tabs. (Most notably it appears on the Insert tab of the ribbon, in the Header & Footer group, and if you are working within a header or footer, on the Design tab of the ribbon, in the Header & Footer group.) The choices presented by the Page Number tool include a Page X of Y group that provides different ways to insert the formatted page number. When you make one of these choices, the result is a field similar to the following:

Page { PAGE \* Arabic \* MERGEFORMAT } of { NUMPAGES \* Arabic \* MERGEFORMAT }

This field code looks much longer than the handcrafted one presented earlier, but it is essentially the same; it just has a few switches added for each of the field codes.

Melissa's page layout most likely includes a section break between the title page and the first real page of the document. This assumption seems appropriate since Melissa indicated that she was able to basically suppress (hide) the page numbers on the title page and have the first real page start with page 1. The problem is that the field codes use the NUMPAGES field to get the desired "X of Y" type of page numbers. If your document has only two sections in it (one for the title page and the other for the rest of the document) you can simply change the NUMPAGES field to the SECTIONPAGES field. This field returns the total number of pages in the section (the main body of the document) instead of the total page count for the document. Your field code would, essentially, look like this:

Page { PAGE } of { SECTIONPAGES }

You can make the change by simply positioning the insertion pointer in the footer, next to the page numbers, and pressing Alt+F9. This displays all the field codes in the document instead of the field code results. Just make the change to the second field, replacing the letters "NUM" with "SECTION". Press Alt+F9 again, and your page numbering should be correct, showing Page 1 of 79.

This approach will not work, however, if you have more than the single section break in your document. In that case you'll need to simply make a bit more complex change to the field codes used for the page number. Follow these steps:

  1. Position the insertion point just before the Y page number. At this point the field is probably highlighted automatically by Word.
  2. Delete the Y page number field.
  3. Press Ctrl+F9. Word inserts an empty set of field code braces.
  4. Type an equal sign and a space.
  5. Press Ctrl+F9 again. Word inserts another empty set of field code braces.
  6. Type NUMPAGES and a space.
  7. Position the insertion point just between the final two right braces.
  8. Type a minus sign and a 1. Your field code for the Y page number should now look very similar to this:
  9. { = { NUMPAGES } - 1 }
    
  10. Press Shift+F9 to collapse the fields.

This approach works because you are subtracting 1 (the length of the title page) from the total number of pages in the document. Thus, you end up with Page 1 of 79.

The two approaches discussed so far work great if you are going to be modifying the document and know that the length of your main body will change over time. If this assumption is not correct—if your document is static and it will never have less or more than 79 pages—then you can skip messing with the field code and simply type a static page count for the Y page number. (Just make sure you delete the field code for the Y page number first.)

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (5882) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Office 365.

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

Emoticons in Word

Like to add a smiley or two to your writing? Word makes it easy through creative use of the AutoCorrect feature.

Discover More

Unique Date Displays

Need to print an elapsed date in a strange format? It's easier to do than may appear at first glance. Here's a discussion ...

Discover More

Files Opening Slowly If Many Files Exist

Managing large numbers of documents in Word can lead to some interesting challenges. One potential challenge is that your ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Using a Single-Column Heading in a Multi-Column Layout

Want different numbers of columns all on the same page? Word makes it easy to use, for instance, a heading that uses a ...

Discover More

Automatic Page Numbers across Multiple Documents

Word allows you to specify the starting page number for a document, which comes in handy if you have multiple documents ...

Discover More

Quickly Displaying the Page Setup Dialog Box

The Page Setup dialog box is indispensable in setting up the overall look of your document. You can display the dialog ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, 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}] 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 nine more than 4?

2019-10-18 08:32:04

Krondor

Thanks for the coding Allen

Has made my life so much easier since stumbling upon your tips web page.


This Site

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

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, 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.