Skip to content

Logical Functions

Function Syntax Example Description
IF IF(condition, value_if_true, value_if_false) =IF(A1>10, "High", "Low") Returns one of two values based on a condition
AND AND(logical1, ...) =AND(A1>0, B1>0) TRUE if all arguments are TRUE
OR OR(logical1, ...) =OR(A1>0, B1>0) TRUE if any argument is TRUE
NOT NOT(logical) =NOT(A1>10) Reverses TRUE/FALSE
XOR XOR(logical1, ...) =XOR(TRUE, FALSE) TRUE if an odd number of arguments are TRUE
IFERROR IFERROR(value, value_if_error) =IFERROR(A1/B1, 0) Returns fallback if expression errors
IFNA IFNA(value, value_if_na) =IFNA(VLOOKUP(...), "Not found") Returns fallback only for #N/A errors
TRUE TRUE() =TRUE() Returns TRUE
FALSE FALSE() =FALSE() Returns FALSE

Multi-condition Functions

IFS

Tests multiple conditions and returns the value for the first TRUE condition.

=IFS(A1>=90, "A", A1>=80, "B", A1>=70, "C", TRUE, "F")

SWITCH

Compares a value against a list of cases and returns the matching result.

=SWITCH(A1, 1, "One", 2, "Two", 3, "Three", "Other")

The last argument (if unpaired) serves as a default value.