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(1A2>=50,2"Pass",3"Fail")| A | B | C | |
|---|---|---|---|
| 1 | Score | Pass | |
| 2 | 62 |
In plain words: 1If the score in A2 is 50 or more, 2show Pass. 3Otherwise show Fail.
C1=IF(A2>100,A2*0.1,0)
| A | B | C | |
|---|---|---|---|
| 1 | Score | 0 | |
| 2 | 62 |