SheetRocks
Documentation/Formulas/IF

IF

Returns the first value if logical_expression is TRUE; otherwise returns the second value.

Syntax

IF(logical_expression, value_if_true, [value_if_false])

Arguments

Argument Description Required
logical_expression A logical expression or a value that can be evaluated as TRUE or FALSE. Required
value_if_true The value to return if logical_expression evaluates to TRUE. Required
value_if_false The value to return if logical_expression evaluates to FALSE. Optional

Examples

Simple true/false comparison

=IF(5 > 3, "Yes", "No")
Result ⇒ Yes

Check if cell value meets condition

=IF(A1 >= 90, "A", "B")
Result ⇒ B
A
1 85

IF with only two arguments (defaults to FALSE)

=IF(A1 > 200, "High")
Result ⇒ false
A
1 100

Related Functions

Other Logical functions:


← Back to Formula Reference