Intel Power
Intel Power

Reputation: 29

I cant get the right result with if statement in excel using both IF with AND statement

I am trying to retrieve DIV 1, DIV 2, DIV 3 AND DIV 4 if the values meet the conditions of AND but it only returns DIV 3 even if the values don't meet the condition.

The If statement have created is as below

=IF(AND(O2<=6,V2<=6),"DIV 1",
 IF(AND(O2>=7,V2<=6),"DIV 2",
 IF(AND(O2>=7,V2>=7),"DIV 3",
 IF(AND(O2=9,V2=9),"DIV 4"))))

I want to get DIV 1 if cells O2 and V2 are less than or equal to 6,
I want to get DIV 2 if cells O2 is greater or equal to 7 and V2 is less than or equal to 6,
I want to get DIV 3 if cells O2 and V2 are greater or equal to 7,
I want to get DIV 4 if cells O2 and V2 are equal to 9.

Upvotes: 1

Views: 37

Answers (1)

Solar Mike
Solar Mike

Reputation: 8375

Try this, change the test order as I suggested:

=IF(AND(O2>=9,V2>=9),"DIV 4",IF( AND(O2>=7,V2>=7),"DIV 3",IF(AND(O2>=7,V2<=6),"DIV 2",IF(AND(O2<=6,V2<=6),"DIV 1"))))

Tested and works: enter image description here

Upvotes: 1

Related Questions