You can copy the example data in the following table and paste it in cell A1 of a new Excel worksheet to see the SWITCHfunction in action. If the formulas don't show results, you can select them, then press F2 > Enter.
The SWITCHfunction compares one value against a list of values and returns a result that corresponds to the first match found. You can use the SWITCHfunction when you want to perform a "self-contained" exact match lookup with several possible results.
Let me show you the SWITCHfunction in a real-world scenario. In this table, I have a list of students and their grades, and I need to work out their next steps based on those grades.
Discover how to useExcel’s SWITCHfunction in 2025 to clean up complex nested IF logic. Learn syntax, examples, best practices, and how to return default values when nothing matches.
In this article, I will tell you everything you need to know about the SWITCHfunctioninExcel, show you a couple of examples that will give you an idea of how you can use it in practical situations, and also cover some of the shortcomings of this function. Let’s get to it then. Below is the syntax of the SWITCH function in Excel: Where: