SmJkB‖

F6kQd‖SWITCH

vaCEi‖SWITCH compares expression with value1 to valuen and returns the result belonging to the first value that equals expression. If there is no match and default_result is given, that will be returned.

ebLBc‖Syntax

tFvZx‖SWITCH(expression; value1; result1[; value2; result2][; ... ; [value127; result127][; default_result]])

tip

p8fL8‖If you choose not to specify a default result, 127 value / result pairs may be entered as parameters. If you choose to include a default result at the end of the list of parameters, then only 126 value / result pairs may be entered.


nnW4D‖expression is a text, numeric, logical or date input or reference to a cell.

Z7xiA‖value1, value2, ... is any value or reference to a cell. Each value must have a result given.

ADDqw‖result1, result2, ... is any value or reference to a cell.

9SKCB‖default_result: any value or reference to a cell that is returned when there is no match.

mLsyo‖If no value equals expression and no default result is given, a #N/A error is returned.

GAZG2‖Examples

YQYUn‖=SWITCH(MONTH(A3),1,"January",2,"February",3,"March","No match") returns "January" when A3 contains a date in January, "February" when A3 contains a date in February , etc...

XAFa7‖Technical information

tip

DJsbg‖This function is available since LibreOfficeDev 5.2.


2C7vt‖This function is NOT part of the Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Format standard. The name space is

COM.MICROSOFT.SWITCH

tip

XELDQ‖IF