Help with IF statements comparing more than two fields

C

ChristineKD

I am trying to automate a task that is frequently done in my department
I have created a form in Word 2007 that asks the user about 10 pages o
questions (some as yes/no, some as check boxes, some as open ende
questions using text form fields). Based on their answers, a report wil
be automatically generated. My problem is that I would like to generat
a specific line of text based on answers to three drop down questions.
can easily compare two, but cannot get it to work with a third added.
have searched for hours and have found similar questions, but no answer
that have worked for my particular issue. Here is what I have so fa
(using Ctrl/Fn/F9)...

{IF{= AND ({COMPARE{Field1}= "No"}, {COMPARE{Field2}= "No"})= 1 "Desire
Text" "Text if False"}

This works but I cannot figure out how to add a third field comparison
I am unable to correctly nest the IF statements as suggested on a reall
old thread.

Any help with an example would be greatly appreciated! Thank you.

Christin
 
L

Lisa Wilke-Thissen

Hi,
{IF{= AND ({COMPARE{Field1}= "No"},
{COMPARE{Field2}= "No"})= 1 "Desired
Text" "Text if False"}
This works but I cannot figure out how to add a
third field comparison.

The COMPARE field just compares two conditions:
http://office.microsoft.com/en-us/word-help/field-codes-compare-field-HP005186141.aspx

May be, just nested IF fields are helpful for you:

IF first logical test = true, then second logical test.
IF second logical text = true, then third logical test.
IF third logical test = true, then ....
 
E

ervinte8

I am trying to automate a task that is frequently done in my department.

I have created a form in Word 2007 that asks the user about 10 pages of

questions (some as yes/no, some as check boxes, some as open ended

questions using text form fields). Based on their answers, a report will

be automatically generated. My problem is that I would like to generate

a specific line of text based on answers to three drop down questions. I

can easily compare two, but cannot get it to work with a third added. I

have searched for hours and have found similar questions, but no answers

that have worked for my particular issue. Here is what I have so far

(using Ctrl/Fn/F9)...



{IF{= AND ({COMPARE{Field1}= "No"}, {COMPARE{Field2}= "No"})= 1 "Desired

Text" "Text if False"}



This works but I cannot figure out how to add a third field comparison.

I am unable to correctly nest the IF statements as suggested on a really

old thread.



Any help with an example would be greatly appreciated! Thank you.



Christine

I was able to do something like this:

{ IF { = OR ( { COMPARE { MERGEFIELD } = "Value1" }, { = OR ( { COMPARE { MERGEFIELD } = "Value2" }, { COMPARE { MERGEFIELD } = "Value3" } ) } ) } = 1 "Result1" "Result2" }
 

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