Nesting IF Statements

G

Gaz

How do I nest this together?


If A1 = 0 & B1 =0, "OK"

If A1 >0 & B1 = 0, "No B"

If A1 = 0 & B1 >0, "No A"

If A1 >0 & B1 >0, "OK"


cheers

Gaz
 
F

Fred Smith

Try:
=if(and(a1=0,b1=0),"OK",if(and(a1>0,b1=0),"No B",if(and(a1=0,b1>0),"No
A",if(and(a1>0,b1>0),"OK","None of the above"))))

Regards,
Fred
 
J

Joe User

Gaz said:
How do I nest this together?
If A1 = 0 & B1 =0, "OK"
If A1 >0 & B1 = 0, "No B"
If A1 = 0 & B1 >0, "No A"
If A1 >0 & B1 >0, "OK"

=if(and(A1>0,B1=0), "No B",
if(and(A1=0,B1>0), "No A", "OK"))

If A1 and B1 may be negative, then:

=if(and(A1<>0,B1=0), "No B",
if(and(A1=0,B1<>0), "No A", "OK"))
 
R

Ron Rosenfeld

How do I nest this together?


If A1 = 0 & B1 =0, "OK"

If A1 >0 & B1 = 0, "No B"

If A1 = 0 & B1 >0, "No A"

If A1 >0 & B1 >0, "OK"


cheers

Gaz

And a little different approach, just for kicks:

=CHOOSE(1+BIN2DEC(--(A1>0) & --(B1>0)),"OK","No A","No B","OK")

--ron
 
R

Ron Rosenfeld

How do I nest this together?


If A1 = 0 & B1 =0, "OK"

If A1 >0 & B1 = 0, "No B"

If A1 = 0 & B1 >0, "No A"

If A1 >0 & B1 >0, "OK"


cheers

Gaz

And still another approach:

=INDEX({"OK","No A","No B","OK"},1+(A1>0)*2+(B1>0))

--ron
 

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

Similar Threads


Top