Logical

IF.

Checks whether a condition is met, and returns one value if TRUE, and another if FALSE.

Logical

How it works.

The IF function lets you make logical comparisons between a value and what you expect. An IF statement has two results: the first is if your comparison is True, the second is if your comparison is False.

💡 In simple terms.

Checks whether a condition is true or false. If true, it outputs one value; if false, it outputs another.

Analogy

"Think of this like a referee checking a score: IF the score is 70 or higher, they shout "Pass!"; otherwise, they shout "Fail!"."

Syntax guide.

=IF(logical_test, value_if_true, [value_if_false])

Parameters

logical_testRequired

A condition that can be evaluated to TRUE or FALSE.

value_if_trueRequired

The value to return if logical_test evaluates to TRUE.

value_if_falseOptional

The value to return if logical_test evaluates to FALSE.

Default: "Fail"

Interactive formula builder.

Fill in the input arguments below to construct your custom formula string. Copy it directly to paste into your Excel spreadsheets.

Generated Output

Best Practices

  • You can nest multiple IF statements inside each other to handle more than two outcomes, although the IFS function is now preferred.
  • To leave a cell blank on FALSE, use empty quotes: "" as the value_if_false.

Common Gotchas

  • Avoid nesting more than 3-4 IF functions, as they become extremely hard to debug and maintain. Consider using IFS or VLOOKUP/XLOOKUP tables.