Logical Modern

IF

Tests a condition and returns one value if it is TRUE, another if it is FALSE.

Available in All versions

Syntax

IF(logical_test, [value_if_true], [value_if_false])

What it returns

value_if_true when the test is TRUE, otherwise value_if_false.

Arguments

ArgumentRequiredDescription
logical_test Yes The condition to test (evaluates to TRUE or FALSE).
value_if_true No Value returned if the test is TRUE.
value_if_false No Value returned if the test is FALSE.

Example

A
1Score
275
Result
Pass

Score 75 is ≥ 60, so the test is TRUE and IF returns Pass instead of Fail.

=IF(A2>=60, "Pass", "Fail")

Important to know

value_if_true / value_if_false are technically optional, but omitting them returns 0/FALSE — usually set both.

Deeply nested IFs are hard to read; consider IFS or XLOOKUP.

Related functions

Related learning