Share via

Microsoft Word 2016 - IF Formula - Syntax Code Error!!

tmt ing 0 Reputation points
2026-04-17T17:08:23.2+00:00

I want thisWordTableSyntaxEndState

I did thisWordTableSyntax

But I had this !WordTableSyntaxError

I need help.

Microsoft 365 and Office | Word | For home | Windows
0 comments No comments

1 answer

Sort by: Most helpful
  1. Marcin Policht 92,380 Reputation points MVP Volunteer Moderator
    2026-04-17T18:25:03.8233333+00:00

    It looks like you’re mixing Excel syntax with Word field codes, and Word is very picky about this. In Word tables, formulas must be inserted as field codes, not typed with {} manually, and the formatting switch goes at the end.

    Use Ctrl+F9 to insert the field braces, then type the formula inside.

    Change your formulas to the following:

    { =IF(A1*B1=0, "", A1*B1) \# "# ##0,00" }
    { =IF(A2*B2=0, "", A2*B2) \# "# ##0,00" }
    { =IF(A3*B3=0, "", A3*B3) \# "# ##0,00" }
    { =IF(A4*B4=0, "", A4*B4) \# "# ##0,00" }
    

    For the total, Word works more reliably with positional formulas:

    { =IF(SUM(ABOVE)=0, "", SUM(ABOVE)) \# "# ##0,00" }
    

    Key things that were causing your syntax errors:

    You cannot type {} manually; Word only recognizes them when inserted with Ctrl+F9.

    The formatting switch should be outside the formula, exactly like \# "# ##0,00".

    Depending on your regional settings, commas and spaces in the number format must match your locale (you’re using comma decimals, so "# ##0,00" is correct).

    After entering each field, press F9 to update it.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

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