==SWITCH(expression,val1/result1,[val2/result2],...,[default])
=SWITCH(C5,1,"Poor",2,"OK",3,"Good","?")
This example shows how the SWITCH function can be used to compare a value in a specific cell. This function will compare the value in cell C5 and if the value is 1, it will return Poor, if it is 2, it will return OK, and if it is 3, it will return Good. If the value does not match any of the given cases, it will return a question mark.
=SWITCH(TRUE,A1>=1000,"Gold",A1>=500,"Silver","Bronze")
This function will compare the value in cell A1 to the range of values given and if the value is equal to or greater than 1000, it will return Gold, if it is equal to or greater than 500, it will return Silver, and if it is less than 500, it will return Bronze. If the value does not match any of the given cases, it will return the last value given, which in this case is Bronze.
=SWITCH(TRUE,A1>=1000,"Gold",A1>=500 AND A1<1000,"Silver","Bronze")
This function will compare the value in cell A1 to the range of values given and if the value is equal to or greater than 1000, it will return Gold, if it is equal to or greater than 500 and less than 1000, it will return Silver, and if it is less than 500, it will return Bronze. If the value does not match any of the given cases, it will return the last value given, which in this case is Bronze.
The SWITCH function is a useful tool for comparing a single value to a list of values and returning the first matching value. It is available on both Windows and Mac computers with Office 2019 or Office 365.