Logical
Testing a number against a cutoff
Definition
Testing a number against a cutoff means writing an IF test that returns one flag when the number clears the cutoff and another when it does not.
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 result when the test is true, such as 1. |
value_if_false |
The result when the test is false, such as 0. |
Worked example
A drill sheet flags a score of 60 or more. The score is in B2.
| A: Drill | B: Score |
|---|---|
| Press | 55 |
| Hold | 71 |
| Lift | 60 |
Formula: =IF(B2>=60,1,0)
Result: 0. 55 is below 60, so the false result 0 is shown.
Practice
Cell A2 holds 80. In B2, write a formula that shows 1 when A2 is at least 70, and 0 otherwise.
- In B2, write an IF formula that shows 1 when A2 is at least 70, and 0 otherwise.
- B2 should show the result for 80.
Step 1 of 2
Enter =IF(A2>=70,1,0) in B2.
A2 is 80, which is at least 70, so the result is 1.
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 1.
The next lesson is Showing pass or fail from a score.
Related functions
IF is the function that returns that flag from the cutoff test.
Common mistake
Swapping the flags, as in =IF(B2>=60,0,1): 55 then returns 1, the opposite of the 0 that the cutoff should show.