Link to home
Start Free TrialLog in
Avatar of Mawallace
MawallaceFlag 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
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

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:

https://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Word/A_7236-Macro-code-to-convert-text-to-fields-in-Microsoft-Word.html
Avatar of Mawallace

ASKER

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")
a34mqub9.doc
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial