Using OR statements in an If, then, else statement

G

Gary

I'm trying to create an "if, then, else statement". I understand the basics
of If {mergefield XX} = "A" "Print this" "Dont print this".

How do I have the statement search for multiple criteria..If {mergefield XX}
= "A or B or C" "Print this" "Dont print this"...without having to create a
statement for each variable individually.
 
M

macropod

Hi Gary,

Try:
{IF{={IF{MERGEFIELD XX}= "A" 1 0}+{IF{MERGEFIELD XX}= "B" 1 0}+{IF{MERGEFIELD XX}= "C" 1 0}}> 0 "Print this"}
or
{IF{={IF«XX»= "A" 1 0}+{IF«XX»= "B" 1 0}+{IF«XX»= "C" 1 0}}> 0 "Print this"}

Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message. Likwise, you can't type the chevrons (ie '« »') - they're part of the actual mergefields, which you can
insert from the mailmerge toolbar.
 
G

Graham Mayor

See the example at http://www.gmayor.com/formatting_word_fields.htm -
Testing for a value in one of several fields
Instead of referring to three fields refer to the same one three times with
the three different conditions.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top