Uji beberapa kondisi, kembalikan nilai true terlebih dahulu
=IFS(test1, value1, [test2], ...)
| Parameter | Deskripsi |
|---|---|
test1 |
First logical test. |
value1 |
Result when test1 is TRUE. |
test2 |
[optional] Second test/value pair. |
An IFS formula with 3 tests can be visualized like this:
=IFS(
test1,value1 // pair 1
test2,value2 // pair 2
test3,value3 // pair 3
)
In the example shown below, the IFS function is used to assign a grade based on a score. The formula in E5, copied down, is:
=IFS(C5<60,"F",C5<70,"D",C5<80,"C",C5<90,"B",C5>=90,"A")
In a simple rating system, a score of 3 or greater is "Good", a score between 2 and 3 is "Average", and anything below 2 is "Poor". To assign these va
=IFS(A1>=3,"Good",A1>=2,"Average",A1<2,"Poor")
In the example below, a status code of 100 is "OK", a code of 200 is "Warning", and a code of 300 is "Error". Any other code value is invalid, so TRUE
=IFS(A1=100,"OK",A1=200,"Warning",A1=300,"Error",TRUE,"Invalid")