Ask Your Question

# Revision history [back]

A generic way to specify two conditions in one IF-clause is to use the AND function.

In this case w_whalley's solution is more elegant, but also "wrong", as it won't to get exactly the same result as the "intended" original version

=IF(0<=A1<=80;"A";IF(80<=A1<=95;"B";"C"))

that could be written to make it work like this:

=IF(AND(0<=A1;A1<=80);"A";IF(AND(80<A1;A1<=95);"B";"C"))


This one (as well as the original one) will also return "C" if the value in A1 is negative.

If negative values should just return A as well, then there's another more simple way to do it - as it is pointless to check what the condition before already checked.

=IF(A1<=80;"A";IF(A1<=95;"B";"C"))


The additional check whether A1 is larger than 80 in the second check is superfluous, as it is already in the else-part of the first if, that did check exactly that.

The reason why it doesn't work as expected without the linking is that the first check will already be evaluated. so 0<=A1 is either true or false, in numeric values this is 0 and 1 - and 1<=80 is always true, same problem in the second if (but that is never triggered because of the first condition is always true).

But also note my comment whether using an IF-construct really is what is needed for the desired final result.