Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Susan
 
Posts: n/a
Default Multiple IF condition

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
--
Susan
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor
 
Posts: n/a
Default Multiple IF condition

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Susan wrote:
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



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod
 
Posts: n/a
Default Multiple IF condition

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

"Susan" wrote in message
...
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
--
Susan



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing multiple copies, multiple pages to a sheet? Heather Microsoft Word Help 1 August 26th 05 08:05 PM
Multiple items per condition Zanari Mailmerge 3 August 22nd 05 02:31 PM
text with multiple fonts inserted into document with multiple columns? [email protected] New Users 4 July 22nd 05 01:45 AM
Multiple items per condition Mary Mailmerge 1 April 13th 05 08:29 AM
Multiple docs open multiple words Ron Smith New Users 2 December 11th 04 09:21 PM


All times are GMT +1. The time now is 02:35 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"