Avatar of Mawallace
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Using the IF condition in mal merge

I have a merge field.

I want this to print a sentence if the numerical value of a merge field is positive,.

If negative I want another sentence to be added.

How can this be done?

I have been playing with the IF command - but to no success
Microsoft Word

Avatar of undefined
Last Comment

8/22/2022 - Mon

If this is a tristate situation, i.e. no sentence if the value is zero, it would be simpler to use two IF tests:

{IF {MERGEFIELD Myfield} > 0 "Positive sentence."}{ IF {MERGEFIELD Myfield} < 0 "Negative sentence."}

If you want zero to be included with the positives:
{ IF {MERGEFIELD Myfield} < 0 "Negative sentence." "Positive sentence."}

If you get any complex field representations posted here, you might like to use the macro in this article to convert to actual fields after you have pasted the text on to your document:


This is what is in the document! I thought - but it returns the value >0

I think it is the way I entered the mergefeld

Can you give me some advice- document below 2nd line (I used "p" or "n")
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question