Share via

RESOLVED: Microsoft Word - Formula - IF doesn't work

Anonymous
2024-01-17T12:25:03+00:00

RESOLVED: I found Charles Kenyon's article (https://answers.microsoft.com/en-us/msoffice/forum/all/nested-if-fields-a-method-to-create-them/1ebb072e-92cd-4e8a-9429-03eba072469c) and that helped me to write the formulas in a Word-friendly way. Microsoft, I hope in future you can just make it easy to copy and paste the formula in Excel straight into Word, as it is!

I have looked through the forum and can't find the answer, so here goes:

I'm trying to add this formula into Word, inside a table cell:

=IF(C5>2500,5000,IF((C5*2)<100,100,C5*2))

I can do simple IF formulas. If I do the following, it works in MS Word:

=IF(C5>2500,10,0).

This also works:

=IF(C5>2500,10,C5*2)

As soon as I change the "10" to the real figure I need - 5000 - it goes wrong. If I even change that figure to 100, it says "Syntax Error".

What can I do to make the first formula work?

I should mention that this MS Word document is supposed to work as a form. I have used Bookmarks (so C5 now has a name) and the file will have Restrict Editing turned on, so the formula needs to update on its own, without the user manually updating it.

Please help!

Many thanks.

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. Charles Kenyon 167.4K Reputation points Volunteer Moderator
    2024-01-17T19:19:28+00:00

    I'm glad my article helped.

    Yes, Word and Excel use different syntax and formulae to accomplish the same thing.

    Much that can be done in Excel cannot be done in Word.

    You can incorporate an Excel table in a Word document.

    There it is not following Word rules but Excel rules and you have all of Excel's tools available. Unfortunately, with such a table, you do not necessarily have all of Word's formatting tools available. (I have not worked with this much, though.)

    Also, I've added the following to the article, which might have helped you.

    Fields in Tables

    If you are trying to insert a complex field in a Table, there is often no room in the cell to see and edit the field. Create and edit it outside the table structure then paste it back in.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Suzanne S Barnhill 277.7K Reputation points MVP Volunteer Moderator
    2024-01-17T12:38:50+00:00

    I haven't used IF fields with numbers this way, but the reference article doesn't show commas between the elements or parentheses around the expression. It looks to me as if you're trying to use the syntax of the IF function in Excel. Also, although you aren't required to use quotation marks for the TrueText and FalseText unless there are spaces, in this instance I suppose it couldn't hurt.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2024-01-17T13:02:40+00:00

    Hi Suzanne

    Thanks for your reply. You're right, the original formula is in Excel and I had assumed it worked that way in Word. How wrong was I?

    Was this answer helpful?

    0 comments No comments