Logical function

Google Sheets IF function

Returns one value if a condition is true and another if it is false.

Syntax

=IF(condition, value_if_true, [value_if_false])
conditionA test that is TRUE or FALSE, such as B2>=70.
value_if_trueWhat to return when the test is TRUE.
value_if_falseOptional. What to return when it is FALSE (default FALSE).

Try it

Edit the formula and the result updates instantly. Click a cell to add its reference.

▦ Test scores
fx
Result: Pass
ABCDEF
1StudentScoreSubmittedMin scoreGrade
2Lily88TRUE0F
3Omar72TRUE60D
4Priya95TRUE70C
5SamFALSE80B
6Tom64TRUE90A
7Uma59TRUE
8Vic81TRUE

Examples

These use the sample sheet above.

→ Pass

Lily scored 88, so she passes.

→ Fail

Uma scored 59.

→ B

IFs can be nested to handle more than two outcomes.

Tips & common mistakes

Related functions