Getting a Proper Total Page Count

by Allen Wyatt
(last updated August 10, 2013)

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 to get the desired "X of Y" type of page numbers use the NUMPAGES field. 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 approach 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, and 2013.

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

Automatically Formatting Text within Quotes

Some people use quote marks around text to make it stand out. At some point you may want to treat the quoted text ...

Discover More

Retrieving Drive Statistics

Need to gather some information about the drives on a system? It can be pretty easy to do using a macro, as shown in this ...

Discover More

Who Has the File Open?

Open a workbook that someone else is working on, and you won't be able to save your changes back into the same file. Wouldn't ...

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 WORDTIPS (RIBBON)

No Space Before at the Top of a Page

Want to make sure that Word handles space before a paragraph correctly when the paragraph is at the top of a page? Check the ...

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 box ...

Discover More

Default Font for Page Numbers

Page numbers are a common addition to documents, and a great aid to readers. If you want to easily format page numbers, you ...

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 for this tip:

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 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.

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.

Links and Sharing
Share