Reply
 
Thread Tools Display Modes
  #1   Report Post  
ChristineKD ChristineKD is offline
Junior Member
 
Posts: 0
Question Help with IF statements comparing more than two fields

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
  #2   Report Post  
ChristineKD ChristineKD is offline
Junior Member
 
Posts: 0
Default

LOL! As soon as I posted this my husband, who writes macros for a living and previously told me he did not have time to help me with this, changed his mind. After 10 minutes of listening to him complain about the way things are written in Word, he fixed it for me. I am posting the solution to help others who may be looking for the answer like I was.
{IF{Field1}= "No" {IF{Field2}= "No" {IF{Field3}= "No" "Desired Statement" "Text if False"} "Text if False" } "Text if False" }

Christine

Quote:
Originally Posted by ChristineKD View Post
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
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Lisa Wilke-Thissen Lisa Wilke-Thissen is offline
external usenet poster
 
Posts: 123
Default Help with IF statements comparing more than two fields

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/wo...005186141.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 ....

--
Cheers,
Lisa [MS MVP Word]


  #4   Report Post  
Posted to microsoft.public.word.docmanagement
[email protected] ervinte8@gmail.com is offline
external usenet poster
 
Posts: 1
Default Help with IF statements comparing more than two fields

On Monday, June 25, 2012 5:56:32 PM UTC-5, ChristineKD wrote:
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









--

ChristineKD


I was able to do something like this:

{ IF { = OR ( { COMPARE { MERGEFIELD } = "Value1" }, { = OR ( { COMPARE { MERGEFIELD } = "Value2" }, { COMPARE { MERGEFIELD } = "Value3" } ) } ) } = 1 "Result1" "Result2" }
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
Help with If statements in a Word Table using Form fields Carol Microsoft Word Help 11 November 26th 08 12:51 AM
IF Statements in Word Fields Erika Microsoft Word Help 1 August 1st 07 11:58 AM
Merge fields in IF statements not working [email protected] Microsoft Word Help 5 August 24th 06 01:41 PM
IF Statements and REF Fields Anna Cooper Microsoft Word Help 1 October 15th 05 06:12 AM
IF Fields With AND Statements Brendan Vassallo Microsoft Word Help 4 March 11th 05 02:47 AM


All times are GMT +1. The time now is 01:00 AM.

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"