Multiple IF condition

S

Susan

Would appreciate the proper syntax for the following "If Statement":
If (HOUSE = BLUE or GREEN) and (STREET = COLOR) say "BLUE or GREEN"
otherwise say "NOT A MATCH".

This is how far I've gotten,
{IF {= OR ({COMPARE {MERGEFIELD HOUSE} = “BLUEâ€},{COMPARE {MERGEFIELD HOUSE}
= “GREENâ€}, {COMPARE {MERGEFIELD STREET} = “COLORâ€})} >1 “BLUE OR GREEN
COLOR†“NOT A MATCHâ€}

Thanks in advance
 
G

Graham Mayor

The following should work

{ IF{ =({ IF{ Mergefield House } = "BLUE" 1 0 } + { IF { Mergefield House }
= "GREEN" 1 0 } + { IF { Mergefield Street } = "COLOR" 1 0}) } = 2 "BLUE
OR GREEN" "NOT A MATCH" }

See http://www.gmayor.com/formatting_word_fields.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

macropod

Hi Susan,

There are numerous ways of doing this. One way is:

{IF{=({IF{MERGEFIELD House}= Blue 1 0}+{IF{MERGEFIELD House}= Green 1
0})*{IF{MERGEFIELD Street}= Color 1 0}}= 1 "BLUE or GREEN" "NOT A MATCH"}

Cheers
 

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