Logical
Showing pass or fail from a score
Definition
Showing pass or fail from a score means writing an IF formula that labels the score with one of those two words.
Syntax
=IF(logical_test, value_if_true, value_if_false)
Arguments
| Argument | Meaning |
|---|---|
logical_test |
The comparison, such as B2>=60. |
value_if_true |
The label when the test is true. Wrap text in double quotes. |
value_if_false |
The label when the test is false. Wrap text in double quotes. |
Worked example
A module labels a mark of 60 or more as pass. The mark is in B2.
| A: Module | B: Mark |
|---|---|
| Quiz | 75 |
| Lab | 41 |
| Oral | 60 |
Formula: =IF(B2>=60,"pass","fail")
Result: pass. 75 is at least 60, so the true label is shown.
Practice
Cell A2 holds 40. In B2, write a formula that shows pass when A2 is at least 50, and fail otherwise.
- In B2, write an IF formula that shows pass when A2 is at least 50, and fail otherwise.
- B2 should show the result for 40.
Step 1 of 2
Enter =IF(A2>=50,"pass","fail") in B2.
A2 is 40, which is not at least 50, so the result is fail.
Formulas here use English function names, such as SUM, and a period as the decimal separator, in every language.
Loading the sheet…
B2 uses IF.
B2 now shows fail.
The next lesson is Looking up a price by product key.
Related functions
IF is the function that returns pass or fail from that score test.
Common mistake
Swapping the labels, as in =IF(B2>=60,"fail","pass"): 75 then returns fail, the opposite of pass.