Excel Switch Function | syntax and its applications

excel switch function
Excel Tutorial GeneralLeave a Comment on Excel Switch Function | syntax and its applications

Excel Switch Function | syntax and its applications

Here at Armancomputer -an online magazine (Blog) we concentrate on computing software and applications. One of the most popular software applications in data analysis is Microsoft Excel, and its new functions are more challenging.  In this post, we want to introduce a new logical function called Excel switch function. If you have many levels as countable values, using this function, an expression may be computed depending on those values. We will show the syntax of this function and demonstrate some examples and its application instead of IF (or IFS) function in Excel.


Excel Switch Function Syntax

excel switch function and it parameters
excel switch function and it parameters

The switch function has many parameters as shown below. This function calculates an expression and based on its values returns any results. The expression (calculated or constant) is its first parameters, and its value set are located as resutl1. result2, and so on. Any return results express by ressult1, result2 and etc. For instant, assume that in cell A1 we have a binary value (0,1), and we want cell B1 show yes if A1 = 1 and NO otherwise. The formula is as follows.

switch function and its example
switch function and its example

In the switch function, there is a default value that will be returned if the expression value does not match any of the values provided. However, this default value must be inserted as a value without a result. For instance, we can enter any value in cell A1 and return “Not Applicable” in cell B1 if A1 has a value other than 0 or 1. This situation can be demonstrated as follows: the value “Not Applicable” will appear in cell B1 because the value in cell A1 is not 0 or 1. excel switch function and its applications.

Excel Switch Function instead of IF function

As we mentioned before the expression parameters must return a value not condition. But we can write conditions in values parameters and as each condition meet, we will return suitable action or calculation. Here is an example. Assume we want to exam A1 value and return yes if it is less than 10 and no otherwise. See the following formula. excel switch function and if function The first parameter in switch function is TRUE and any values parameters will be compared with that, if they are compromise then yes and otherwise No will be returned. In this example we show how you can use switch function instead of IF (or nested IF- IFS). Now three conditions will be checked. switch function and IF function        

Loading

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top