Logical functions sort rows into groups.
IF ... THEN ... ELSEIF ... ELSE ... END tests conditions in order and stops at the first true one.
CASE [Field] WHEN "a" THEN ... WHEN "b" THEN ... ELSE ... END compares one field with a list of values. It reads better than a chain of ELSEIFs on the same field.
IIF(test, then, else) is a one-line IF, handy inside other calculations.
Empty values, called NULL, need care. Any comparison with NULL is neither true nor false, so IF [Satisfaction] >= 4 sends unrated tickets straight to ELSE, where they get mixed up with real answers. Test for them first:
ISNULL([Closed Date]) is true for open tickets.
IFNULL([Closed Date], #2025-12-31#) swaps in a value when the field is empty.
ZN([x]) turns a NULL number into 0.
This lesson uses the Northwind Help Desk data, which has real NULLs.