The SWITCH function evaluates an expression against a list of values and returns the result corresponding to the first matching value. If no match is found, an optional default value is returned.
SWITCH(expression, val1, res1, val2, res2, ..., val_n, res_n, default)
Returns the result corresponding to the first matching value. If no match is found, returns the default value (if specified).
SWITCH(Sub-Category, "Bookcases", 4.55, "Chairs", 2.67, "Tables", 2.81, "Art", 1.35,
"Paper", 3.79, "Machines", 10.55, "Envelopes", 1.23, "Storage", 2.53, 0)
Evaluates the Sub-Category value and returns the corresponding numeric value for each match; if no match is found, returns 0.
