Spread.NET 18 Formula Reference
Formula Functions / Functions R to S / SWITCH
In This Topic
    SWITCH
    In This Topic

    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.

    Version Available

    This function is available in Spread for Windows Forms 11.0 or later.