
What does the NOT function do?
This function performs negation of the input logical value.
It can also be said differently - the function checks the truth value of an expression. If the input value or calculation is false, the function result is TRUE, and vice versa.
NOT function syntax
=NOT(Logical)
| A | B | |
|---|---|---|
| 1 | Value | NOT |
| 2 | TRUE | FALSE=NOT(A2) |
| 3 | FALSE | TRUE=NOT(A3) |
| 4 | 5 | FALSE=NOT(A4) |
| 5 | 0 | TRUE=NOT(A5) |
| 6 | "TRUE" (text) | FALSE=NOT("TRUE") |
| 7 | apple | #VALUE!=NOT(A7) |
| 8 | (empty) | TRUE=NOT(A8) |
Numbers: 0 is FALSE, anything else is TRUE. Text typed into the formula as "TRUE" or "FALSE" is understood; other text gives #VALUE!. An empty cell counts as 0, so NOT returns TRUE.
NOT: result and input format
Requirements for input values are similar to the AND and OR functions.
The difference may be in the result format - AND and OR return a single value. Negation with the NOT function is performed with each of its elements and returns a similar array.
Any numbers other than zero are interpreted as TRUE, zero - as FALSE.
Any text values, except "FALSE", "TRUE" in text format, return a #VALUE! error.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Value | Not empty | Not text | Not between 10 and 20 |
| 2 | 15 | TRUE=NOT(ISBLANK(A2)) | TRUE=NOT(ISTEXT(A2)) | FALSE=NOT(AND(A2>=10,A2<=20)) |
| 3 | FALSE=NOT(ISBLANK(A3)) | TRUE=NOT(ISTEXT(A3)) | TRUE=NOT(AND(A3>=10,A3<=20)) | |
| 4 | apple | TRUE=NOT(ISBLANK(A4)) | FALSE=NOT(ISTEXT(A4)) | TRUE=NOT(AND(A4>=10,A4<=20)) |
| 5 | 25 | TRUE=NOT(ISBLANK(A5)) | TRUE=NOT(ISTEXT(A5)) | TRUE=NOT(AND(A5>=10,A5<=20)) |
NOT turns any check into its opposite: not empty, not text, outside a range. Text compared with numbers counts as greater, so “apple” is “not between 10 and 20”.
Other logical functions
Like the article? Help its author! Buy !SEMTools, it has lots of useful instruments to process text data.