Document Editing Problems

Use Nested IF Fields in Microsoft Word to Number Only Content Pages

Anum MushtaqAnum Mushtaq Nov 13, 2026 869 views

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.

Use Nested IF Fields in Microsoft Word to Number Only Content 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.
Before you start

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.

Solution 1Recommended

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.

1
Open the page-number location

Double-click the header or footer on a content page. Select the existing page-number field if you want to replace it.

2
Insert the nested fields

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.

3
Adjust for even-numbered content pages

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.

4
Update and check the result

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 MOD in an IF field to display numbers only on alternating content pages
Irregular blank pages need a different approach: MOD cannot detect blank content. If blank pages occur irregularly, use section-based page numbering instead of an odd/even formula.
Free Microsoft Office alternative

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.

Insert standard page numbers and edit headers and footers in WPS Writer.Open and save Microsoft Word .doc and .docx files.Use familiar document-editing controls in a lightweight office suite.Move everyday Word documents to WPS Writer, checking complex field results before final output.
microsoft office alternative - wps office

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.