Nested IF AND functions.

D

Deb

I have not used Excel functions for a while and apparently can't figure it
out now. I
need to have 5 logical tests to be true in an IF statement. Does anyone know
the correct format with commas and parenthesis in the right place? Thanks, Deb
 
D

Dave Peterson

=if(and(a1="ok",b1=13,c42="xxy"),"all true","at least one false")

(I stopped before I got to 5 tests.)
 
S

ShaneDevenshire

Hi,

This is actually and interesting issue, you could do this at least two way
and there are advantages to both:

As Dave has suggested
IF(AND(test1,test2,test3,test4,test5),"all true")

where a test is something like A1>10

Another solution would be
=IF(test1,IF(test2,IF(test3,IF(test4,IF(test5,"all true")))))

My question to the newsgroup - In both cases I have left the formulas so the
will evaluate to FALSE if not all conditions are met. If test1 fails in the
first case will test2 be executed? In the second case if test1 fails the
calculation if over. So will form 1 run faster than form 2 at least in the
scenario where the test1 fails?
 

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