Logical
NOT
Definition
NOT returns TRUE when its test is false, and FALSE when its test is true.
Syntax
=NOT(logical)
Arguments
| Argument | Meaning |
|---|---|
logical |
A test that is either true or false, such as A2="shut". |
Worked example
A marina marks a berth Open unless the status is shut. Status words are in A2:A4.
| A: Status |
|---|
| open |
| shut |
| open |
Formula: =IF(NOT(A2="shut"),"Open","Closed")
Result: Open. A2 is open, so A2="shut" is false, NOT flips that to true, and IF returns Open. Filled down, the formula gives Open, Closed, and Open.
Practice
Cell A2 holds 5. In B2, write a formula that returns 1 when A2 is not equal to 0, and 0 otherwise.
- 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 5.
Related functions
NOT is usually placed inside IF so the cell can show one result when the flipped test is true and another result when it is false.
Common mistake
Writing =NOT(A2) when A2 holds text: NOT needs a true/false test, so the word open returns #VALUE! instead of flipping A2="shut".