Nested If / And / Or ?

T

Titian

Greetings

Is there any way the following can be expressed in single formula?

If A2 = 1 and B2 <= 10 - "Yes"

If A2 = 1 and B2 > 10 - "No"

If A2 = 2 and B2 <= 20 - "Yes"

If A2 = 2 and B2 > 20 - "No"

Thanks in advance.



Dan
 
B

Bryan Hessey

=If(or(and(A2=1,B2<=10),and(A2=2,B2<=20)),"Yes",if(or(and(A2=1,B2>10),and(A2=2,B2>20)),"No","")

There are options that will leave the cell blank (= "" )
 
B

Bryan Hessey

=IF(OR(AND(A2=1,B2<=10),AND(A2=2,B2<=20)),"Yes",IF(OR(AND(A2=1,B2>10),AND(A2=2,B2>20)),"No",""))

There are options that will leave the cell blank (= "" )
 
T

Titian

"Bryan Hessey" wrote in message
=IF(OR(AND(A2=1,B2<=10),AND(A2=2,B2<=20)),"Yes",IF(OR(AND(A2=1,B2>10),AND(A2=2,B2>20)),"No",""))

There are options that will leave the cell blank (= "" )

Thanks so much Bryan

it works a treat.

cheers
Dan
 
Top