- SpreadJS Overview
- Getting Started
- JavaScript Frameworks
- Best Practices
- Features
- SpreadJS Designer
- SpreadJS Designer Component
- SpreadJS Collaboration Server
- Touch Support
-
Formula Reference
- Formula Overview
-
Formula Functions
- Barcode Functions
- Compatibility Functions
- Database Functions
- Date and Time Functions
- Engineering Functions
- Financial Functions
- Information Functions
- Logical Functions
- Lookup and Reference Functions
- Math and Trigonometric Functions
- Statistical Functions
- Sparkline Functions
- Text Functions
- Web Functions
- RegEx Functions
- Other Functions
- Import and Export Reference
- Frequently Used Events
- API Documentation
- Release Notes
(Showing Draft Content)
SWITCH
This function compares specified expression against given list of values and returns the result according to the first matching value.
Syntax
SWITCH(expression, value, result, result_no_match)
Arguments
This function has the following arguments:
Argument | Description |
|---|---|
expression | Value or expression to compare |
value | Value compared against expression |
result | Value returned if comparision matches |
result_no_match | Value returned if comparision do not match |
Remarks
In this function, argument value and result can take upto 126 different entries each.
Data Types
Accepts data of any type. Returns data of any type.
Examples
SWITCH(WEEKDAY(A2),1,"Sunday",2,"Monday",3,"Tuesday","No match") gives the result No match.