Group:  Microsoft Word ยป microsoft.public.word.mailmerge.fields
Thread: Word 2000 Mailmerge - Display Field if two criteria met

Geek News

Word 2000 Mailmerge - Display Field if two criteria met
JoePineapples 11/17/2008 6:07:01 PM
Hi All

I can use the IF function for one criteria but is it possible to have two
criteria.

eg.

IF {Criteria1} = x AND {Criteria2} = y THEN Show Field

Any help would be much appreciated.


Re: Word 2000 Mailmerge - Display Field if two criteria met
"Peter Jamieson" <pjj[ at ]KillmapSpjjnet.demon.co.uk> 11/17/2008 6:32:18 PM
There are a few possible approaches, e.g. the "obvious" one:

{ IF {Criteria1} = x "{ IF { Criteria2} = y "{ the field you want }" "" }"
"" }

In some cases you may be able to combine the criteria in a useful way, e.g.

{ IF "{Criteria1}{Criteria2 }" = "xy" "{ the field you want }" "" }

(that's a string concatenation, not a multiplication. In that case it
wouldn't be helpful if Criteria1 could be "xy" and Criteria2 could be "",
for example)

Or you can use a number of types of calculation, e.g.

{ IF {={ COMPARE { Criteria1} = x }+{ COMPARE { Criteria2 } = y } } = 2 "{
the field you want }" "" }

{ IF {=AND({ COMPARE { Criteria1} = x },{ COMPARE { Criteria2 } = y }) } = 1
"{ the field you want }" "" }


--
Peter Jamieson
http://tips.pjmsn.me.uk

"JoePineapples" <JoePineapples[ at ]discussions.microsoft.com> wrote in message
news:74D72837-ADB3-4938-A1FA-F11D08E1EDD2[ at ]microsoft.com...
[Quoted Text]
> Hi All
>
> I can use the IF function for one criteria but is it possible to have two
> criteria.
>
> eg.
>
> IF {Criteria1} = x AND {Criteria2} = y THEN Show Field
>
> Any help would be much appreciated.
>
>

Re: Word 2000 Mailmerge - Display Field if two criteria met
"Peter Jamieson" <pjj[ at ]KillmapSpjjnet.demon.co.uk> 11/17/2008 7:07:38 PM
BTW, each pair of {} needs to be the special fild braces that you can enter
using ctrl-F9. You can't use the ordinary {} keyboard characters.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Peter Jamieson" <pjj[ at ]KillmapSpjjnet.demon.co.uk> wrote in message
news:eyMtULOSJHA.5344[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text]
> There are a few possible approaches, e.g. the "obvious" one:
>
> { IF {Criteria1} = x "{ IF { Criteria2} = y "{ the field you want }" "" }"
> "" }
>
> In some cases you may be able to combine the criteria in a useful way,
> e.g.
>
> { IF "{Criteria1}{Criteria2 }" = "xy" "{ the field you want }" "" }
>
> (that's a string concatenation, not a multiplication. In that case it
> wouldn't be helpful if Criteria1 could be "xy" and Criteria2 could be "",
> for example)
>
> Or you can use a number of types of calculation, e.g.
>
> { IF {={ COMPARE { Criteria1} = x }+{ COMPARE { Criteria2 } = y } } = 2
> "{ the field you want }" "" }
>
> { IF {=AND({ COMPARE { Criteria1} = x },{ COMPARE { Criteria2 } = y }) } =
> 1 "{ the field you want }" "" }
>
>
> --
> Peter Jamieson
> http://tips.pjmsn.me.uk
>
> "JoePineapples" <JoePineapples[ at ]discussions.microsoft.com> wrote in message
> news:74D72837-ADB3-4938-A1FA-F11D08E1EDD2[ at ]microsoft.com...
>> Hi All
>>
>> I can use the IF function for one criteria but is it possible to have two
>> criteria.
>>
>> eg.
>>
>> IF {Criteria1} = x AND {Criteria2} = y THEN Show Field
>>
>> Any help would be much appreciated.
>>
>>
>

Re: Word 2000 Mailmerge - Display Field if two criteria met
"macropod" <macropod[ at ]invalid.invalid> 11/17/2008 8:09:24 PM
HI JoePineapples,

Here's another way of approaching the problem, assuming your criteria are mergefields:
{IF{={IF{MERGEFIELD Criteria1}= x 1 0}*{IF{MERGEFIELD Criteria1}= y 1 0}= 1 "True Output" False Output"}
The same technique works with other REF fields, etc., also.

FWIW you can keep expanding this with more expressions like '*{IF{MERGEFIELD Criteria1}= x 1 0}' if necessary. Also,.if you wanted
to convert this to an OR test, you could simply replace the '*' with '+' and change the '= 1' to '> 0'.

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[MVP - Microsoft Word]


"JoePineapples" <JoePineapples[ at ]discussions.microsoft.com> wrote in message
news:74D72837-ADB3-4938-A1FA-F11D08E1EDD2[ at ]microsoft.com...
[Quoted Text]
> Hi All
>
> I can use the IF function for one criteria but is it possible to have two
> criteria.
>
> eg.
>
> IF {Criteria1} = x AND {Criteria2} = y THEN Show Field
>
> Any help would be much appreciated.
>
>

Re: Word 2000 Mailmerge - Display Field if two criteria met
"macropod" <macropod[ at ]invalid.invalid> 11/17/2008 8:16:09 PM
Oops! Try:
{IF{={IF{MERGEFIELD Criteria1}= x 1 0}*{IF{MERGEFIELD Criteria1}= y 1 0}}= 1 "True Output" "False Output"}

--
Cheers
macropod
[MVP - Microsoft Word]


"macropod" <macropod[ at ]invalid.invalid> wrote in message news:epPk0APSJHA.3300[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text]
> HI JoePineapples,
>
> Here's another way of approaching the problem, assuming your criteria are mergefields:
> {IF{={IF{MERGEFIELD Criteria1}= x 1 0}*{IF{MERGEFIELD Criteria1}= y 1 0}= 1 "True Output" False Output"}
> The same technique works with other REF fields, etc., also.
>
> FWIW you can keep expanding this with more expressions like '*{IF{MERGEFIELD Criteria1}= x 1 0}' if necessary. Also,.if you wanted
> to convert this to an OR test, you could simply replace the '*' with '+' and change the '= 1' to '> 0'.
>
> Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
> them from this message.
>
> --
> Cheers
> macropod
> [MVP - Microsoft Word]
>
>
> "JoePineapples" <JoePineapples[ at ]discussions.microsoft.com> wrote in message
> news:74D72837-ADB3-4938-A1FA-F11D08E1EDD2[ at ]microsoft.com...
>> Hi All
>>
>> I can use the IF function for one criteria but is it possible to have two
>> criteria.
>>
>> eg.
>>
>> IF {Criteria1} = x AND {Criteria2} = y THEN Show Field
>>
>> Any help would be much appreciated.
>>
>>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net