Use Nested IF Fields in Microsoft Word to Number Only Content Pages
Question details
The user needs to correct a nested IF field and number only content pages in a Word document that contains intervening blank pages.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Content pages alternate with blank pages, and the displayed page numbers should count content pages rather than every physical page.
- Observed behavior
- The nested IF field produces a syntax error instead of the intended page number.
Turn on Home > Show/Hide (¶) to identify whether the blank pages come from manual page breaks or Odd Page/Even Page section breaks. Check whether content appears on odd or even PAGE values and whether section numbering restarts, since these affect the calculation.
Use MOD in an IF field to display numbers only on alternating content pages
Use this approach when content and blank pages alternate consistently and PAGE numbering continues throughout the document.
Word supports nested IF fields. Field braces must be inserted as actual Word fields, not typed as ordinary curly braces. An arithmetic result inside an IF field must be a nested formula field beginning with an equals sign.
The examples below assume the underlying PAGE values start at 1 and continue without restarting. They test page-number parity, not whether a page is actually blank.
Double-click the header or footer on a content page. Select the existing page-number field if you want to replace it.
In Word for Windows, press Ctrl+F9 to insert each pair of field braces and type the text between them. For content on odd-numbered pages, build this field: { IF { = MOD({ PAGE }, 2) } = 1 "{ = ({ PAGE } + 1) / 2 }" "" }. Every brace pair shown must be created with Ctrl+F9.
If content appears on PAGE values 2, 4, 6, and so on, use this field instead: { IF { = MOD({ PAGE }, 2) } = 0 "{ = { PAGE } / 2 }" "" }. Insert every brace pair with Ctrl+F9 rather than typing braces.
Select the completed field and press F9 to update it. Press Alt+F9 to switch between field codes and results, then check several content and blank pages. The matching content pages should display 1, 2, 3, and so on; the other pages should show no number from this field.

Use section breaks when blank pages are inserted for odd-page starts
Use this approach when blank pages exist only to make the next section start on an odd or even page.
Use a separate first-page number if your formula returns zero
Use this only when your chosen calculation gives zero on the first content page and that page should display 1.
Manage Standard Document Page Numbers with WPS Writer
WPS Writer is a free, lightweight alternative for everyday document editing and standard page numbering. Its familiar interface and support for Word formats make migration straightforward, but it is not a guaranteed fix for Microsoft Word nested IF field errors.

Frequently Asked Questions
Why does my nested IF field show a syntax error?
A common cause is typed braces instead of real field braces, or arithmetic entered without a nested formula field. In Word for Windows, insert every brace pair with Ctrl+F9, start calculation fields with =, and select the completed field before pressing F9 to update it.
Can Word automatically tell whether a page is blank?
A PAGE-based IF field does not inspect page content. MOD tests whether the PAGE value is odd or even, so it works only when the content pages follow a consistent alternating pattern. Turn on Home > Show/Hide (¶) to inspect irregular blank pages and section boundaries.
Do Odd Page section breaks remove blank pages from the page count?
No. Blank pages automatically inserted by Layout > Breaks > Odd Page do not display headers or footers, but they still count in pagination. Use a suitable field calculation or Page Number > Format Page Numbers > Start at to control the displayed sequence.
Do I need Different First Page for every numbering formula?
No. Enable Different First Page in the Header & Footer tab only if you need a separate first-page display. The odd-content-page calculation (PAGE + 1) / 2 already returns 1 on the first page.
Will restarting page numbers in a section affect MOD?
Yes. MOD uses the PAGE field's value, which can restart at a section boundary. Open Page Number > Format Page Numbers and choose Continue from previous section if the alternating-page formula depends on a continuous sequence.




