Logical
Flipping a true or false test
Definition
Showing 1 when a test is not true means wrapping NOT inside IF.
Syntax
=IF(NOT(logical),1,0)
Arguments
| Argument | Meaning |
|---|---|
logical |
The test to flip, for example B2>10. |
Worked example
A meter sheet flags a reading in B2 when it is not above 10.
| A: Meter | B: Reading |
|---|---|
| M-1 | 4 |
| M-2 | 18 |
| M-3 | 10 |
Formula: =IF(NOT(B2>10),1,0)
Result: 1. 4 is not greater than 10, so NOT flips the failed test and IF shows 1.
Practice
Cell A2 holds 0. In B2, write a formula that shows 1 when A2 is not equal to 0 and 0 when it is 0.
- In B2, write an IF formula that uses NOT and shows 1 when A2 is not 0, and 0 otherwise.
- B2 should show the result for 0.
Step 1 of 2
Enter =IF(NOT(A2=0),1,0) in B2.
A2 is 0, so the result is 0.
Formulas here use English function names, such as SUM, and a period as the decimal separator, in every language.
Loading the sheet…
B2 uses NOT.
B2 now shows 0.
The next lesson is Catching an error from a divide.
Related functions
NOT is the function that flips the test.
Common mistake
Leaving IF out, as in =NOT(B2>10): the cell then shows TRUE or FALSE instead of 1 or 0.