Skip to main content
← All functions

IF function

Specifies a logical test to perform

Syntax

IF(logical_test, value_if_true, [value_if_false])

Square brackets indicate optional arguments.

Arguments

ArgumentRequiredMeaning
logical_testYesThe condition you want to test.A2 = "foo"
value_if_trueYesThe value that you want returned if the result of logical_test is TRUE."A2 is foo"
value_if_falseNoThe value that you want returned if the result of logical_test is FALSE."A2 is not foo"

Try IF

Choose a review label from a numeric test

=IF(A2>10,"Review","OK")

Choose a review label from a numeric test. The result is checked against a separately authored expected value for the supplied table. You can edit the data to explore the rule.

Inspect the current formula

Read its written arguments or observe actual operation values in a separate local calculation. This action neither applies a draft nor grades an answer.

Read the formula, one argument at a time

Explore the written function calls and their inputs. The calculation result belongs to the complete formula.

IF · top-level call

=IF(A2>10,"Review","OK")

1 / 3 · logical_test

The condition you want to test.

IF reference ↗

Follow the cells behind a result

Read explicit local references and helper formulas using a separate calculation. Your draft stays in this field; the worksheet and practice checks do not change.

The worksheet runs locally. Published checks apply to the supplied example only. Native Excel and Google Sheets compatibility remain unverified.

Practice a complete task

Reference and compatibility

Univer 1.0.4 / Apache-2.0. Calculation checks cover the supplied examples only. The browser worksheet does not implement every Excel feature, external service or connected data type.