Use an ordered IFS formula so that Excel returns the class associated with the first matching threshold:
=IFS(E128<=0,0,E128<=350,2,E128<=631,4,E128<=1200,8,TRUE,10)
IFS evaluates conditions from left to right and returns the value paired with the first TRUE condition, making it suitable for ordered classifications in Microsoft 365. The final TRUE,10 provides the default for anything above 1200. ^1^
Boundary results
This formula defines the boundaries explicitly:
| Value in E128 |
Result |
<= 0 |
0 |
> 0 and <= 350 |
2 |
> 350 and <= 631 |
4 |
> 631 and <= 1200 |
8 |
> 1200 |
10 |
If 0 should also receive class 2, remove the first test:
=IFS(E128<=350,2,E128<=631,4,E128<=1200,8,TRUE,10)
The expression starts with:
IF(AND(E128>0,E128<350),2,0) * ...
Outside that first range, this returns 0. Because it is multiplied by everything after it, the entire formula must then return zero.
Additionally, OR returns only TRUE or FALSE; it does not select and return values such as 4, 8, or 10. Nonzero numeric arguments such as 4 are treated as true in that logical test. OR is intended to determine whether any supplied condition is true, while IF supplies the value to return. ^2^ The documented pattern is IF(AND(conditions), value_if_true, value_if_false) or IF(OR(conditions), value_if_true, value_if_false). ^3^
Your original comparisons also exclude exactly 350, 631, and 1200, because both neighboring tests use strict < and > comparisons. Using <= in the ordered formula assigns each boundary to one class without overlaps or gaps.
References
- IFS function | Microsoft Support
- OR function | Microsoft Support
- Using IF with AND, OR, and NOT functions in Excel | Microsoft Support