Learn How to Use Microsoft Excel SWITCH Function
In this article, you will learn how to use the Microsoft Excel SWITCH function and its prime function in Microsoft Excel. You will also get to know the Microsoft Excel SWITCH function return value and syntax with the help of some examples. So, let's
Microsoft Excel SWITCH Function
The prime use of the SWITCH function is to match multiple values and return the first TRUE match. That implies the Microsoft Excel SWITCH function one value against all the values provided in the list and return a result corresponding to the first match. The SWITCH function may return the optional default value when there is not any match.
The SWITCH Function Return Value
The result is as per the first match.
The SWITCH Function Syntax
=SWITCH (expression, val1/result1, [val2/result2], ..., [default])
- expression: This is the value or expression you want to match against.
- val1/result1: This is the first value and result pair.
- val2/result2: This is the second value and result pair, which is optional.
- Default: You can use the default value when no pair is matched; this is also optional.
How to Use Microsoft Excel SWITCH Function?
As we know, the SWITCH function compares the value provided in the list and returns the result as per the first match. The SWITCH function can also be used when you want to perform the exact match with different possible results, and it will return the default value if no match is found.
The first argument in the SWITCH function is known as "expression," and that can be a cell reference or another formula that can return the specific value you match against the list. The matching value and corresponding results are entered in the pairs, and you can manage 126 pairs with the SWITCH function.
Check out the list of all other articles:
- Learn How to Get nth Match in Microsoft Excel
- Learn How to Find Missing Values in Microsoft Excel
- Learn How to Get nth Smallest Value With Criteria in Microsoft Excel
- Learn How to Sort by Text Length in Microsoft Excel
- Learn How to Sort by Two Columns in Microsoft Excel
- Learn How to Sort by Random in Microsoft Excel
- Learn How to Sort by One Column in Microsoft Excel
- Learn How to Sort by Custom List in Microsoft Excel