# IF AND troubles

1. ## IF AND troubles

• IF K27 is equal to 0, then ELEPHANT,
• IF K27 is greater than 0, then LION
• IF K27 is greater than 0 and E45 is greater than 0, then TIGER

=IF(K27=0, “ELEPHANT”, IF(K27>0, “LION”, IF(AND(K27>0, E45>0), “TIGER”))))

Why oh why doesn't this work? THANK YOU!

2. ## Re: IF AND troubles

Your first two criteria have the same condition - which do you want returned; elephant or lion?

Also the third criteria will only be evaluated if the 1st 2 are false, but it also needs to be true in order for tiger to be returned.

3. ## Re: IF AND troubles

1) =IF(K27=0, “ELEPHANT”,
2) IF(K27 > 0, “LION”,
3) IF(AND(K27>0, E45>0), “TIGER”))))

3) will only get executed if 2) is FALSE
but if 2) is FALSE then your AND will not work since the K27 > 0 part of 3) will evaluate to FALSE

Try this

=IF(K27=0, “ELEPHANT”, IF(AND(K27>0, E45>0), “TIGER”,IF(K27>0, "LION","OTHER")))))))

4. ## Re: IF AND troubles

1 and 2 shouldn't be the same. If K27 is 0, then I want to see ELEPHANT. If it's greater than 0, then I want to see LION.

Special-K, I pasted your formula in, but it read "The Formula you typed contains an error."

5. ## Re: IF AND troubles

Special-K's formula has a few too many close brackets.

=IF(K27=0, "ELEPHANT", IF(AND(K27>0, E45>0), “TIGER”,IF(K27>0, "LION","OTHER")))

PS Apologies for misreading your requirements - it's been a long day

6. ## Re: IF AND troubles

That'll teach me not to check my answers. Try this

=IF(K27=0,"ELEPHANT",IF(AND(K27>0,E45>0),"TIGER",IF(K27>0,"LION","OTHER")))

7. ## Re: IF AND troubles

Special-K, you are my hero!!!!

8. ## Re: IF AND troubles

under what conditions do you want to see TIGER?
K27=0, “ELEPHANT”
K27>0, “LION”
...(AND(K27>0, E45>0), “TIGER”))))...this will always be supersceded by K27>0, “LION”, becasue both test for K27>0, and K27>0, “LION” comes 1st, so that criteria is met before the 2nd criteria

There are currently 1 users browsing this thread. (0 members and 1 guests)