Logical functions
The 20 logical functions in Sheets, with the usual names, arguments and results.
| Function | What it does | Syntax |
|---|---|---|
| ANDexample | TRUE if all are TRUE | AND(logical1, logical2, ...) |
| BYCOL | Apply a LAMBDA to each column | BYCOL(array, lambda) |
| BYROW | Apply a LAMBDA to each row | BYROW(array, lambda) |
| FALSE | The logical value FALSE | FALSE() |
| IFexample | Conditional | IF(condition, value_if_true, [value_if_false]) |
| IFERRORexample | Fallback if value errors | IFERROR(value, value_if_error) |
| IFNA | Fallback if value is #N/A | IFNA(value, value_if_na) |
| IFSexample | First value whose condition is TRUE | IFS(condition1, value1, [condition2, value2, ...]) |
| ISOMITTED | TRUE if a LAMBDA argument is missing | ISOMITTED(argument) |
| LAMBDA | A reusable function | LAMBDA([parameter1, ...], calculation) |
| LETexample | Name values for a calculation | LET(name1, value1, [name2, value2, ...], calculation) |
| MAKEARRAY | Array computed by a LAMBDA per cell | MAKEARRAY(rows, cols, lambda) |
| MAP | Apply a LAMBDA to each value | MAP(array1, [array2, ...], lambda) |
| NOT | Logical negation | NOT(logical) |
| ORexample | TRUE if any is TRUE | OR(logical1, logical2, ...) |
| REDUCE | Accumulate an array into one value | REDUCE([initial_value], array, lambda) |
| SCAN | Running accumulation over an array | SCAN([initial_value], array, lambda) |
| SWITCHexample | Result for the matching value | SWITCH(expression, value1, result1, ..., [default]) |
| TRUE | The logical value TRUE | TRUE() |
| XOR | TRUE if an odd number are TRUE | XOR(logical1, [logical2, ...]) |