Compares a given value or range with other given expressions, and returns a result corresponding to the first match.
Syntax
expression: Any value or cell range to test. Eg., A2
test: The value to be compared with the given expression. Eg., 5
value: The value to be returned corresponding to the specified test conditions. Eg., "Excellent"
Examples
|
Formula |
Result |
|
=SWITCH(A2;5;"Excellent";1;"Poor";"Good") |
Good |
|
=SWITCH(D2;"F";"Fail","Pass") |
Pass |
Possible Errors
|
Errors |
Meaning |
|
#N/A! |
|
|
#NAME! |
|
|
#VALUE! |
|
|
#REF! |
|
Similar Functions