# Excel SWITCH Function

This post will guide you how to use Excel SWITCH function with syntax and examples in Microsoft excel.

### Description

The Excel SWITCH function compares one value against a list of values, and returns the result corresponding to the first matching value. A default value can be returned if none of the supplied values match the test value.

The SWITCH function is a build-in function in Microsoft Excel and it is categorized as a Logical Function.

The SWITCH function is available in Excel 2016.

### Syntax

The syntax of the SWITCH function is as below:

`=SWITCH(expression, value1, result1, [default or value2, result2],…[default or value3, result3])`

Where the SWITCH function arguments are:

• Expression -This is a required argument.  The expression or a value that is to be compared.
• value1, values2,… valuen – The value that will be compared against expression.
• result1, result,… result – The value that to be returned when the corresponding value argument matches expression.
• default -This is an optional argument.  The default value to be used when no matching is found.

### Excel SWITCH Function Examples

The below examples will show you how to use Excel SWITCH Function to compare one value against a list of values and returns a result corresponding to the first match.

1# =SWITCH(B1,1,”Sunday”,2,”Monday”,3,”Tuesday”,”none”)

If the value in Cell B1 is equal to 1, it returns “Sunday”, and if it is equal to 2, then returns “Monday”, or if it is equal to 3, then returns “Tuesday”, otherwise, return “none”.

Related Posts

Excel DVAR Function

This post will guide you how to use Excel DVAR function with syntax and examples in Microsoft excel. Description The Excel DVAR Function will get the variance of a population based on a sample of numbers in a column in ...

Excel DSUM Function

This post will guide you how to use Excel DSUM function with syntax and examples in Microsoft excel. Description The Excel DSUM Function will add the numbers in a column or database that meets a given criteria. And so you ...

Excel DSTDEVP Function

This post will guide you how to use Excel DSTDEVP function with syntax and examples in Microsoft excel. Description The Excel DSTDEVP returns the standard deviation of a population based on the entire population of numbers in a column or ...

Excel DSTDEV Function

This post will guide you how to use Excel DSTDEV function with syntax and examples in Microsoft excel. Description The Excel DSTDEV returns the standard deviation of a population based on a sample of numbers in a column or database ...

Excel DMIN Function

This post will guide you how to use Excel DMIN function with syntax and examples in Microsoft excel. Description The Excel DMIN returns the minimum value from a database or a column of a list that matches the specified conditions. ...

Sidebar