SWITCH (PQL - xl)

This function compares specified expression against given list of values and returns the result according to the first matching value

  • Library: PQL \ Spreadsheet \ Logical
  • Compatibility: Any content (regardless of data source) in the Tabulate spreadsheet module
  • Solve: This function can be used with the Solve plug-in: both as part of the objective function and constraint functions

Syntax

SWITCH(OPTIONAL expression, value, result, default or value)

Function Arguments

Name

Description

Type

Optional

expression

Value or expression to compare

StringOrNumber

Y

value

Value compared against expression

StringOrNumber

result

Value returned if comparison matches

StringOrNumber

default or value

Value returned if comparison do not match

StringOrNumber

Comments

This function is the same as the Microsoft Excel 'SWITCH' function - using the same inputs, logic and outputs.