3 possibilities for IF

R

RC

I cannot find a post that adddressed my issue specifically, most of the
posts similar to this only relates to having 2 options...

Since there is apparently not an easy way to use "OR" statments, I need
to be able to create the following logic in my document:

IF {MERGEFILED Blah } = "A" or "B" or "C" then "YES" else "NO"

Any help would be appreciated. Thanks!

-Rich
 
D

Doug Robbins - Word MVP

{ IF {MERGEFIELD Blah } = "A" "Yes" { IF {MERGEFIELD Blah } = "B" "Yes" { IF
{MERGEFIELD Blah } =""C" "YES" "NO" }}}

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
C

computergeek

Although that does work well for one word results (Ex. Yes.) It is not
practical for a lenghty result which, if needed to be modified, would have to
be modified in TWO or THREE places. Also, what if there are more than three
options in your merge field? I think your example works well if there are
only three variables and you have only short results which never will need to
be modified. Is there an OR argument, like RC asks? If mergefield = A or B
then "Yes" if not then "No"
See how "yes" only appears once and if the answer is anything between C-Z
you still get the other answer?
 
D

Doug Robbins - Word MVP

My view is that data manipulation is really best done in a database.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
M

macropod

Hi Folks,

You can reduce the number of True/False outputs to one each, quite easily:
{IF{IF{MAILMERGE Field1}= "A" 1 0}*{IF{MAILMERGE Field2}= "B" 1
0}*{IF{MAILMERGE Field3}= "C" 1 0}= 1 "True Text" "False Text"}

Cheers
 
G

Graham Mayor

While I agree with Doug here, if you wish to insert longer strings than yes
or no you can save them as autotext entries and insert autotext fields, then
any changes can be made to the autotext entries themselves and so all will
change together. Or you could use SET fields to define your responses in
bookmarks and REF fields to place the results. You can nest up to 20 fields
though admittedly that gets a bit unwieldy The possibilities are many
depending on what is actually required.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
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