Pass or fail
| A | B | |
|---|---|---|
| 1 | Student | Score |
| 2 | Ana | 72 |
Formula: D2: =IF(B2>=70,"Pass","Fail")
Result: Pass
72 is at least 70, so the true branch is returned. Text results go in quotes.
To apply IF to every row from one cell in Google Sheets, wrap it: ARRAYFORMULA(IF(B2:B10>=70,"Pass","Fail")).
IF(logical_test, [value_if_true], [value_if_false])Without ARRAYFORMULA, IF looks only at the first cell of a range.
For a fuller explanation of the arguments and common errors, see the IF Excel guide.
| A | B | |
|---|---|---|
| 1 | Student | Score |
| 2 | Ana | 72 |
Formula: D2: =IF(B2>=70,"Pass","Fail")
Result: Pass
72 is at least 70, so the true branch is returned. Text results go in quotes.
| A | B | |
|---|---|---|
| 1 | Student | Score |
| 2 | Ben | 84 |
Formula: D2: =IF(B2>=90,"A",IF(B2>=80,"B","C"))
Result: B
The second IF sits in the false branch of the first. For more than three outcomes prefer IFS.
| A | B | C | |
|---|---|---|---|
| 1 | Name | Age | Member |
| 2 | Cara | 21 | Yes |
Formula: E2: =IF(AND(B2>=18,C2="Yes"),"Eligible","Not eligible")
Result: Eligible
AND is true only when both tests are true. Use OR when one is enough.
A tiny spreadsheet with example data. Edit the formula or any number and see the result.
Formula in F2: =IF(B2>=60,"Pass","Fail")
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Student | Score | Extra credit | Attempts | Result | |
| 2 | Ann | 92 | Yes | 2 | Pass | |
| 3 | Bob | 74 | No | 0 | ||
| 4 | Cy | 58 | Yes | 3 | ||
| 5 | Dee | 81 | No | 1 | ||
| 6 | Eli | 66 | 2 |
Google Sheets is used here only as a descriptive product name. FormulaCamp is not affiliated with Google.
Enter — commit · F2 — edit · F4 — $ in a reference · Ctrl+C/Ctrl+V — copy and paste · Ctrl+Z — undo
Esc or F6 — leave the sheet for the «Check» button · Shift+Tab in the first cell — back to the page