Share via

IF statement

Anonymous
2016-12-03T02:35:11+00:00

I am using Word 2013.  I would like to create an IF statement in the template footer so that it puts page numbers on all pages except for the last two pages which will be left blank.  Can you please let me know the correct wording for the statement - thank  you,

Ricki

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
    2016-12-03T22:24:44+00:00

    Use:

    { IF { = { NUMPAGES } - { PAGE } } > 1 "______________________" }

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2016-12-03T18:22:36+00:00

    Hi and thanks for the response.  I am actually trying to have signing lines in the footer on all pages except for the last two pages.  I have used Control+F9 to create the braces, and have typed the following: 

    {if{numpages}-{page} > 2 "______" " "}

    I get an error:  Error! Unknown op code for conditional.

    I would appreciate some advice - thanks again,

    Ricki

    You could use an IF field coded along the lines of:

    {IF{NUMPAGES}-{PAGE}> 2 {PAGE}}

    Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Alternatively, you could add the fields via Word's Insert|Quick Parts|Field dialogue.

    Was this answer helpful?

    0 comments No comments
  3. Paul Edstein 82,861 Reputation points Volunteer Moderator
    2016-12-03T03:10:09+00:00

    You could use an IF field coded along the lines of:

    {IF{NUMPAGES}-{PAGE}> 2 {PAGE}}

    Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Alternatively, you could add the fields via Word's Insert|Quick Parts|Field dialogue.

    Was this answer helpful?

    0 comments No comments