Function reference · Logical

IF

Returns one value when a test is true and another when it is false.

IF(logical_expression, value_if_true, value_if_false)

IF is the branch: test something, and hand back one of two answers. Almost every status column, flag and traffic-light in a spreadsheet is an IF underneath.

Arguments

ArgumentRequiredWhat it does
logical_expression Yes Anything that evaluates to TRUE or FALSE.
value_if_true Yes What to return when the test passes.
value_if_false Optional What to return otherwise. Omitted, you get FALSE.

Worked example

RegionRepSales
WestAna1200
EastBen900
WestCara1500
NorthDan600
EastEve1100
=IF(C2 > 1000, "On target", "Below")

Returns On target.

Ana's 1200 clears the threshold, so the cell reads On target.

Gotchas

Related functions