SWITCH |
SWITCH(expression, value1, result1 [,value2, result2] [,default]) |
Returns the value based on a list of exact matches. |
expression | The expression to be compared to the values. |
value1 | The value to compare. |
result1 | The result if the expression equals the value. |
value2 | (Optional) The value to compare. |
result2 | (Optional) The result if the expression equals the value. |
default | (Optional) The value to return when there are no matches. |
REMARKS |
* This function was added in Excel 2019 to allow for multiple conditions based on a list of exact matches. * For an overview of conditional formulas refer to this page * This function is not case sensitive when matching text strings. * This function does not support wildcards (? and *). * This function will return the first matching item in the list. * The "values" can be numbers or text. * The "results" can be any expression. * If none of the "values" match and a "default" value has been provided, then the default value is returned. * If none of the "values" match and a "default" value has not been provided, then #N/A! is returned. * You can have a maximum of 126 (values and results). * If the function is not available, then #NAME? is returned. * You can use the IF function to return the value based on whether a certain condition is True or False. * You can use the IFS function when you have multiple conditions that are not exact matches (for example < or >). * You can use the CHOOSE function to return the value in a row (or column) based on an index number. * For the Microsoft documentation refer to support.microsoft.com * For the Google documentation refer to support.google.com |
|
1 - What value is returned when the cell "B4" is compared to this list of exact matches. 2 - What would the equivalent formula be using the IFS function. 3 - What would the equivalent formula be using multiple nested IF functions. 4 - What is the first result where the value matches the number "1". 5 - What is the first result where the value matches the number "2". 6 - What is the first result where the value matches the string "Tokyo". 7 - What is the first result where the value matches the string "TOKYO". This function is not case sensitive. 8 - What is the first result where the value matches the string "Tokyo". 9 - What is the first result where the value matches the string "findtext". The value is not found so the default value is returned. 10 - What is the first result where the value matches the string "findtext". The value is not found and no default value has been provided. 11 - What is the first result where the value matches the number "3". The value is not found and no default value has been provided. |
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top