IF in Google Sheets

Returns one value when a test is TRUE and another when it is FALSE. Put text results in double quotes.

In Google Sheets

IF works the same way in Google Sheets. Over a whole range, wrap it in ARRAYFORMULA to fill a column with one formula.

Syntax

IF(logical_test, [value_if_true], [value_if_false])
logical_test
A comparison that is TRUE or FALSE, such as A2>=50.
value_if_true (optional)
What to return when the test is TRUE.
value_if_false (optional)
What to return when the test is FALSE.

Examples

C1=IF(A2>=50,"Pass","Fail")
ABC
1ScorePass
262

In plain words: If the score in A2 is 50 or more, show Pass. Otherwise show Fail.

C1=IF(A2>100,A2*0.1,0)
ABC
1Score0
262

Practice IF

Related functions