Nested IF statement

  • Thread starter Thread starter Ricki Miles
  • Start date Start date
R

Ricki Miles

I am working in Excel 2003. Cell A1 can contain several different words
(WHOLE, SKIM, ETC). B1, C1, D1 and E1 can contain either the words "YES" or
"NO". If A1 contains the word "WHOLE" and B1, C1, D1 and E1 all contain
the word "YES", I need to put the word "CORRECT" in F1. I am having
difficulty nesting the IF statements and would appreciate any help. Thanks,

Ricki
 
I am working in Excel 2003.  Cell A1 can contain several
different words (WHOLE, SKIM, ETC).  B1, C1, D1 and
E1 can contain either the words "YES" or "NO".    If A1
contains the word "WHOLE" and B1, C1, D1 and E1 all
contain the word "YES", I need to put the word "CORRECT"
in F1.  I am having difficulty nesting the IF statements and
would appreciate any help.

Well, the following would suffice for the example above. In F1:

=if(and(A1="whole",B1="yes",C1="yes",D1="yes",E1="yes"), "correct",
"")

However, if your more-general problem is more complex that you
described, you might need a different kind of solution.
 
Try it this way:

=IF(AND(A1="WHOLE",COUNTIF(B1:E1,"YES")=4),"CORRECT","wrong")

Hope this helps.

Pete
 
Thank you all so much - it is working now. I appreciate the help!

Ricki

Try it this way:

=IF(AND(A1="WHOLE",COUNTIF(B1:E1,"YES")=4),"CORRECT","wrong")

Hope this helps.

Pete
 
Back
Top