Getting a Proper Total Page Count

by Allen Wyatt
(last updated August 10, 2013)

40

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

Scaling Your Printing

If you want to cram more of your worksheet onto each page of a printout, one way to do it is by using scaling. Here's how you ...

Discover More

Use Filenames that Sort Properly

If you take some care when you name your document files, you'll find it much easier to manage those files at a later time. ...

Discover More

Editing Custom Dictionaries

Custom dictionaries can be great, but they take quite a bit of time to create. Word provides a way you can edit your custom ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Determining Page Layout

Getting your document onto paper is the whole purpose of word processing. Here are some concepts that are important when ...

Discover More

Decreasing Space between Body Text and Footer Text

Figuring out how you want the text in your document to appear on the printed page can sometimes be a bit perplexing. Word ...

Discover More

Understanding the Gutter Margin

Most everyone knows that Word allows you to set top, bottom, left, and right margins for your document. There is another type ...

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

2017-05-04 23:21:54

Richard Hutchins

This was very helpful - I was trying to use the total number of pages in my footer; however, I did not want to include the pages in the index at the end of the document.
Apparently, I can use it total number of pages field and modify it to exclude the index.
Thank you.


2017-03-15 11:50:00

Maria P

This help was much better than Word's built in help. Word didn't even understand what I wanted to do, so couldn't answer my question. Thank you!!


2017-02-23 01:14:11

Philippa

Thanks for this one - saved my bacon when time was very short!
(I'm already on your mailing list)


2017-02-17 10:07:14

Syd

I solved my issue. I shouldn't have changed the X page number using the formula.

Word (2013) makes it easy to change the X page. Put your cursor in the footer to activate the Header & Footer Tools tab. Click the Page Number dropdown and select Format Page Numbers. Then under "Page numbering" check "Start at" and select the value of the page number you want to start at (this controls the X page number).

After doing this, updating the TOC field reflected the correct page number for each section title listed in the TOC. I still had to use the formula with a "-6" to give the total page count that I wanted.

Thanks again for the all info.


2017-02-17 09:36:13

Syd

Thank you so much for this information. I have 6 pages of front matter to exclude from the page count. I used your information to reduce both X and Y page numbers.

However, my table of contents is not updating to the new page numbers. The TOC section titles correspond to the actual physical pages in the whole document, ignoring the formula in the page number field. Any suggestions on how to resolve this? Updating the field (page numbers only or entire field) doesn't work.


2017-01-18 13:33:35

Kam

Trevor, as long as all your appendices are in ONE section (i.e., no section breaks) you can use something like this:

{ PAGE } of { SECTIONPAGES }

Remember to reset page numbering to 1 at the start of your appendices.

If you have section breaks, you'll have to use creative workarounds like those described in the first two comments on this site.


2017-01-17 22:48:37

Trevor

Hi Allen

Your description is very straight forward to the point. EXCELLENT.

I have another query and I am sure you may have written it else where. In the WORD document after main text, if I have Appendices, how do I number those X of Y pattern where Y should pick up the total number of Pages in the Appendices Section.

Kind Regards
Trevor


2016-12-21 09:49:05

Kam

A tip that might be helpful: Shift+F9 only expands the field you're currently editing if it's selected or if your cursor is in it. An improperly formatted field might disappear completely from the screen, so you can select an area that includes your field and press Shift+F9 to expand it, or use ALT+F9 to expand all fields in the doc.

For anyone who missed it, if you have appendices or an end section that you don't want included in your page count, read Richard's and Sharon's comments all the way at the beginning on how to use bookmarks for this - GENIUS!


2016-11-15 12:50:26

Chris Pulaski

Thank you very much for this very helpful article.


2016-10-21 21:15:49

Mervin

I was trying to do this programatically. I inserted an index too in a different section. Index consists of 6 pages. But {SECTIONPAGES} returns 1 . Index was inserted using insert -> quick parts -> field.

Any idea?


2016-09-07 23:15:11

mere

i dont get it it wont work on me


2016-08-30 07:57:56

Ted

My degree, Civil engineering. My profession for many years, relational databases. I mention that only as relevance to my comment.

Microsoft's Engineers have created highly competent word processing software that is, IMHO, quite often and in many ways too complex for non-technically oriented users -- and that includes me.

I'd like to see it work more like any "point-and-shoot" calculation. Not a complaint. Just an observation.


2016-08-29 11:04:40

Kris

Thank you very much!


2016-07-20 13:19:33

Amber

I have a report with multiple sections throughout and an appendix at the end. I do not want the appendix to be in the total page count however using SectionPages is not an option because I have section breaks through out the document. I am creating a template for my office reports. Is there a way to only omit the last section and include all the previous sections?

Thanks,
Amber


2016-07-15 12:03:08

Marvin

This is exactly what I was looking for. I was able to remove my title page and table of contents from the total page count. Thanks so much!


2016-06-30 14:07:02

Donna Jones

Thank you!!!!


2016-06-21 23:08:18

Keith

I forgot to mention that if the numbering can continue from previous, the page math doesn't need to change and will span sections. It's only when the centered page (the one controlled by word's page formatting) changes from the previous that the math need to change.


2016-06-21 22:53:40

Keith

I tried so many times. The precise order of character entry and ctrl-F9 seems to have differentiated these instructions from all the others out there.
The goal with one unnumbered cover, roman contents and a page of pages: (. is a space and word seems to need them)(center page # controlled by words numbering format system)
filename ii Page 3 of 30

{.FILENAME.*.MERGEFORMAT.} tab {.PAGE.} tab Page.{.=.{.PAGE.*.Arabic.*.MERGEFORMAT.}+1}.of.{.NUMPAGES.*.Arabic.*.MERGEFORMAT.}

and once the roman # stop:

{.FILENAME.*.MERGEFORMAT.} tab {.PAGE.} tab Page.{.=.{.PAGE.}+4}.of.{.NUMPAGES.*.Arabic.*.MERGEFORMAT.}

I tried to remove many of the spaces and it stopped producing results..many hours on this.


2016-04-05 14:14:56

Josh

I have both a title page and a few contents pages with Roman Numerals (Table of Contents, Table of Figures, List of Tables, and Abbreviations Used) before my document really starts followed by an appendix. My document is far from being complete at this point so I am anticipating the number of contents pages to increase as well as the total length of my document.

My document currently have 4 section which are the Title Page, the Contents Pages, the Document, and the Appendix.

I have all of the X pages numbers correct but is there a way to get my Y correct without having to change the field codes as my document increases in size (and potentially adds additional sections for additional Appendices)?

The current Appendix needed to have the pages in landscape to properly display the tables contained within it which is why the section break was needed versus a page break.


2016-03-28 12:28:04

Allison

Thank you so much!!!!! This is exactly what I was looking for.

I've always been so frustrated with the page numbering mechanics in Microsoft Word, especially regarding the Page X of Y format. When I add a Title Page and Table of Contents, the numbering format always messes up. Furthermore, I often write surveys where there will be many section breaks within the document so sometimes the page numbering goes awry. Thank you again for sharing this information :)


2016-03-22 01:53:06

Victoria

Hi, what I need to know is this: How can I change Word's character counter to a page counter? I print out lots of articles (after I copy and paste them to a Word doc) and need to know in advance how many pages are going to print out.
I've Googled this question several times but only get tutorials about the word counter.
Any advice would be appreciated!
Thanks!


2016-03-15 13:40:54

Audrey

I have a 2nd section break to change the orientation of the next page in my document. I want that page to be included in my total number of pages however. Do I place my insertion point before the Y on that specific page or the Y on page #1 of my document?

Thank you so much for your website!


2016-03-04 17:15:00

George

This was very helpful. The only tip I found that fully understood what was needed.

@Ferry, the answer to your question is buried in the text of this page -- divide your doc into 2 sections and use { SECTIONPAGES } instead of { NUMPAGES } will give you the total number of pages in the section.


2015-12-05 18:03:03

Chris

THANK YOU THANK YOU THANK YOU!!!

After hours of googling, yours was the only article that actually understood the problem and had the simple solution!


2015-11-06 22:33:44

Jay

Worked great, thank you


2015-10-10 15:22:26

Ez

Wow! you made my day. Thank you so much.


2015-09-22 13:44:57

Charudatta Kulkarni

Thank you Allen,
Its very useful tip for me. I am preparing number of RFP for our institute. Love to create multi sectioned documents.


2015-07-22 22:25:04

DV

All I can say this tip Super matic..Grease lightning!!

Yahooo!!!!


2015-06-12 03:58:42

Hui Wen

Lauren,

Use Ctrl + F9 to generate the {} field code instead of manually typing it.

Hope it helps.


2015-04-17 20:09:39

Cfleenor

This is great, but my Table of Contents does not reflect the change. Can you tell me how to get my ToC to show the number on the page, not the actual page count number?


2015-04-14 20:27:54

Lauren

I have tried the formula every which way and I continually get an error code (Syntax Error, {) HELP! Is there any other way of adjusting the total page to exclude the title page?


2015-03-04 05:44:24

Filippo

I had tried for years to do this. An illumination.

thanks

F


2015-02-11 17:50:10

Lynne

Thank you so much

I have tried for years to do that. So excited

Best wishes
Lynne


2015-01-15 08:19:21

Ferry

This is a great help, but is it also possible to for example want to merge 2 word docs and have the x of Y page numbers to stop at the new document?

I got to the point where I found how to add page X of Y and with sections to restart the count of X but not the Y.

I need to restart the Y aswell :)
Hope you have a solution


2014-11-29 05:53:16

Dipak

Excellent, my dear Allen!

I fully agree with Catherine. Your hint was much better than the support provided by Microsoft! It was very useful, and it did work!


2014-11-18 11:47:56

Catherine

Thank you. I have had documents with cover pages at work for years and have used the section page trick as work around to exclude the cover page in the numbering. Was creating a multi-sectioned document and noone else explained how to edit the NUMPAGES field as clearly.


2014-11-02 05:21:03

Mayur

Thanks a Lot.


2014-09-25 00:28:34

Jessica

Thank you so much for this tip! I had a cover page and wanted my numbering to start as page 1 of Y on page 2 of the document, but that meant Y was 1 number too high! So I used your trick and it was perfect, thank you!


2013-09-11 11:13:06

Richard

I use an enhancement of Sharon's tip to display an X of Y sub-range within a document, leaving the footer page number intact. I add an 'End' bookmark to the last page of the sub-range and a 'Start' bookmark to the first page of the sub-range. The X of Y field codes become:
X: { = PAGE - Start +1 }
Y: { = End - Start +1 }
where Start and End refer to the PAGEREF on which the bookmark is located.


2013-08-10 04:40:27

Sharon

Great tip! Another method is to place a bookmark at the very end of the document (such as enddoc - I usually place it on its own line if possible) and in the footer delete the {numpages] code and using the Insert tab, insert a Cross Reference to the page number of that bookmark. Of course, if you delete that last page when editing the document, be sure to recreate that bookmark at the end of the new document.


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.