IFS
Returns the value corresponding to the first TRUE result when evaluating multiple tests.
Syntax
IFS(logical_test1, value1, [logical_test_n], [value_n])
Arguments
| Argument |
Description |
Required |
logical_test1 |
The first logical test to be evaluated. |
Required |
value1 |
The value to return if first condition is true. |
Required |
logical_test_n |
Additional logical test that will be evaluated if the first test is false. |
Optional |
value_n |
Additional value to return if the first test is false. |
Optional |
Examples
Grade assignment based on score
=IFS(A1>=90, "A", A1>=80, "B", A1>=70, "C", A1>=60, "D", true, "F")
Result ⇒
B
Categorize numbers as positive, negative, or zero
=IFS(A1>0, "Positive", A1<0, "Negative", A1=0, "Zero")
Result ⇒
Positive
Shipping cost based on weight
=IFS(A1<=1, 5, A1<=3, 10, A1<=5, 15, true, 25)
Result ⇒
10
Related Functions
Other Logical functions:
- AND - Returns true if all arguments evaluate to true
- CONTAINS - Returns true if a range contains a specified value
- IF - Returns the first value if logical_expression is TRUE; otherwise returns the second value.
- IFERROR - Returns a custom result when a formula generates an error, and a normal result when no error is detected.
- ISBETWEEN - Returns true if a provided number is between two other numbers either inclusively or exclusively; otherwise returns false.
- ISBLANK - Returns true if the value is blank, empty, or null; otherwise returns false.
- ISERROR - Returns TRUE if the value is any error value
- ISEVEN - Returns TRUE if the number is even, FALSE if odd
- ISNA - Returns TRUE if the value is the #N/A error value
- ISNUMBER - Returns TRUE if the value is a number
- ISODD - Returns TRUE if the number is odd, FALSE if even
- ISTEXT - Returns TRUE if the value is text
- NOT - Returns FALSE if logical expression is TRUE and TRUE if logical expression is FALSE.
- OR - Returns true if any argument evaluates to true
← Back to Formula Reference