Fields / Formula / function
Case
Compares the value with each match in turn and gives the result of the first one that matches. The last value, when there is one left over after the pairs, is what it gives when nothing matches.
Syntax
Case(value, match1, result1, match2, result2, ..., otherwise?)Returns
The chosen result, or null.
Example
Case(StageName, "Prospecting", 1, "Negotiation", 2, "Closed Won", 3, 0)Notes and limitations
Leave the last value out and Case gives null (blank) when nothing matches: Case(Region, "EU", "Europe", "US", "Americas"). A match compares as = does: capitals count (WEB is not web), and a blank matches empty text. Every match must be the same kind of value as the first value, and every result the same kind as the others, like IF's two results. Only the result that is picked is worked out, so Case(Code, "A", 10, 1 / 0) gives 10 for A without an error.