Re: Can I compare more than two merge field values using =AND or =

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Hi there,

I'm trying to use the OR function in my Word 2003 document (dutch version),
but I can't get it to work.

I get the following reaction when merging to a new document: Error! Unknown
operator in precondition

Does anyone have an idea why this doesn't work??


"macropod" wrote:

Hi Rhiannon,

You can build a multiple AND test this way:
{IF{={IF{MERGEFIELD 1}= "Y" 1 0}*{IF{MERGEFIELD 2}<> 2 1 0}*{IF{MERGEFIELD 3}= "text" 1 0}}= 1 "True Text" "False Text"}

Similarly, you can build a multiple OR test this way:
{IF{={IF{MERGEFIELD 1}= "Y" 1 0}+{IF{MERGEFIELD 2}<> 2 1 0}+{IF{MERGEFIELD 3}= "text" 1 0}}> 0 "True Text" "False Text"}

--
Cheers
macropod
[Microsoft MVP - Word]


"Rhiannon" <Rhiannon@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:B794C40E-0E78-4DBE-B321-F0E85FB2B0D5@xxxxxxxxxxxxxxxx
I'm working in Word 2007. I have a list of mergefields (anywhere between 3
and 7 depending) that I would like to test the values of - if all of them
come back true, return one block of text, else return another block of text.
It works fine when I try and compare the values of two mergefields:

{IF { = AND ( { COMPARE {Mergefield 1} = "Y"}, {COMPARE {mergefield 2} <> 2
} ) } = 1 "true" "false" }

but as soon as I try and compare the values of three or more mergefields:

{IF { = AND ( { COMPARE {Mergefield 1} = "Y"}, {COMPARE {mergefield 2} <> 2
}, { COMPARE {mergefield 3" = "text" } ) } = 1 "true" "false" }

it breaks. Is there a way to expand beyond two comparisons, using either the
=AND or the =OR formulas? I'd rather not start nesting piles of these if I
can help it. Thanks muchly!!

.



Relevant Pages

  • Re: Can I compare more than two merge field values using =AND or =OR?
    ... you can build a multiple OR test this way: ... [Microsoft MVP - Word] ... It works fine when I try and compare the values of two mergefields: ...
    (microsoft.public.word.mailmerge.fields)
  • Re: OOs best feature survey results
    ... > Interface is a poor man substitution for multiple inheritance. ... The "n" means a numeric compare. ... What is your criteria for which everyday concept to make into ... Relativity ...
    (comp.object)
  • Re: Skip Record If
    ... Word MVP web site http://word.mvps.org ... multiple "Skip Record Ifs"? ... disregarding all my other "compare to's. ...
    (microsoft.public.word.docmanagement)
  • Re: Shorten multiple sumifs
    ... I took your original formula and change the Sum range to be multiple ... regular Sumif is the compare data must be a cell Range and not a ...
    (microsoft.public.excel.programming)
  • Re: Can I compare more than two merge field values using =AND or =
    ... data source, and I need to compare the mergefields in multiple, unique ... services on a paid consulting basis. ... It works fine when I try and compare the values of two mergefields: ...
    (microsoft.public.word.mailmerge.fields)