Using IF statements in a Word table

Jonathan Smith 20 Reputation points
2025-01-20T11:46:36.5066667+00:00

I have a table in a document where I want to use an IF statement. I have a Drop-down form field with two items 'Yes' and 'No'. The form field is set to calculate on exit.

The formula is =IF(B9="Yes",B10*20%,0) which works in Excel, but when I run it in Word I get the !Syntax Error message.

If I put the formula inside field codes, {=IF(B9="Yes",B10*20%,0)} I still get the same error.

Word Management
Word Management
Word: A family of Microsoft word processing software products for creating web, email, and print documents.Management: The act or process of organizing, handling, directing or controlling something.
948 questions
{count} votes

Accepted answer
  1. Jiajing Hua-MFST 13,780 Reputation points Microsoft Vendor
    2025-01-21T09:10:28.5033333+00:00

    Hi @jonathan smith

    Is the value in B10 entered directly or via a Drop-down form field?

    According to your description, I create a simple table as following.

    User's image

    Besides, each Drop-down form field has a bookmark name like following. Dropdown1 and Dropdown2 have two items "Yes" and "No".

    User's image

    • If it's a number entered manually, in my sample, please try this formula {if "{Dropdown1}"="Yes" "{=B4*0.2}" "0"}. You need to use the bookmark name instead of cell name of table, and please replace the B4 with B10, and 0.2 with 20% in yours.

    User's image

    • If you also use a Drop-down form field in B10, in my sample it is Dropdown3, the formula is {if "{Dropdown1}"="Yes" "{={DropDown3}*0.2}" "0"}. Please also remember to use the bookmark name.

    The results of my sample are shown as below.

    User's image

    Please Note: You need to press Alt + F9 at the same time to switch between Edit Mode with Field Codes. Press Ctrl + F9 at the same time to enter {}, then enter the formula inside the curly brackets.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    1 person found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Jonathan Smith 20 Reputation points
    2025-01-22T08:52:46.8133333+00:00

    Many thanks Jiajing Hua, that has resolved my problem! In answer to your question, I only have the one dropdown box with a simple yes or no option, the other data is text. I'm actually creating an expense claim form, and the dropdown box is the answer to whether the claimant has a VAT receipt. This is a form with content controls which will be protected with filling in only.

    I really appreciate you taking the time to address my query, many thanks!

    0 comments No comments

  2. Charles Kenyon 2,956 Reputation points
    2025-01-22T14:49:07.8966667+00:00

    Content Controls do not calculate on exit without macros. They can with macros and set bookmarks. Filling In Forms protection is a legacy method and is extremely restrictive.

    See:

    You should not use legacy formfields in the same document as Content Controls.


  3. Jonathan Smith 20 Reputation points
    2025-01-22T16:29:08.32+00:00

    Thanks Charles. If I use a drop down list content control the if statement doesn't work, but if I use a legacy drop-down form field the if statement works, despite the form containing other content controls and is restricted to filling in.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.