Function guides · Logical

NOT function

Reverses TRUE to FALSE and FALSE to TRUE.

Syntax

=NOT(logical)
ArgumentWhat it is
logicalA value or expression that evaluates to TRUE or FALSE.

What NOT does

NOT flips a logical value. If the argument is TRUE you get FALSE, and the other way around.

It is the shortest function in the logical family and the one most often skipped. A plain comparison with the not-equal operator covers many cases, but NOT is needed to reverse the result of a function such as ISBLANK, ISNUMBER, AND or OR.

It also reads well in a formula, since “not blank” and “not cancelled” are how people phrase these conditions.

A short way to see when NOT is worth using: say the condition aloud. “The cell is not empty” is NOT(ISBLANK()). “The status is not Cancelled” is simpler as a not-equal comparison. “It is not the case that the order is both paid and shipped” needs NOT around an AND.

NOT also appears inside conditional formatting rules, where the formula must return TRUE for rows to be highlighted. A rule such as =NOT(ISBLANK($B2)) formats every row that has a value in column B, and a rule using =ISBLANK($B2) does the reverse. Tests that ask you to highlight “missing” or “completed” rows are testing exactly this.

NOT examples

1. Not blank

Not blank. The formula =NOT(ISBLANK(B2)) in cell C2 returns TRUE.
ABC
1CustomerPhone
2Hale Pools555-0114TRUE

ISBLANK is TRUE for an empty cell. NOT flips it, so the formula is TRUE when the cell has something in it. Here B2 holds a phone number, so the answer is TRUE.

2. Exclude one category

Exclude one category. The formula =NOT(B2="Cancelled") in cell C2 returns TRUE.
ABC
1OrderStatus
21001OpenTRUE

NOT reads naturally for "everything except". A row is processed unless its status is Cancelled. The status here is Open, so the result is TRUE.

3. Inside IF with AND

Inside IF with AND. The formula =IF(NOT(AND(B2="Yes",C2="Yes")),"Check","Done") in cell D2 returns Check.
ABCD
1OrderPaidShipped
21001YesNoCheck

NOT can wrap an AND to make a "not both" test. This flags a row when it is not true that the order is both paid and shipped. The order is paid but not shipped, so it is flagged.

Common NOT mistakes

  • Using NOT where <> is simpler. NOT(B2="Cancelled") and B2<>"Cancelled" give the same answer. The second is shorter. NOT earns its place around ISBLANK, AND, OR and other functions.
  • Misreading NOT with AND. NOT(AND(a,b)) is TRUE when at least one is false, not when both are false. For both false, use AND(NOT(a),NOT(b)).
  • Passing text. NOT("yes") returns #VALUE!. The argument must be TRUE, FALSE or a comparison.
  • Forgetting that numbers are accepted. NOT(0) is TRUE and NOT(5) is FALSE, since zero counts as FALSE and any other number as TRUE.

NOT on Excel job tests

The cue words are "not", "except" and "unless": flag rows where the email is not blank, count orders that are not cancelled, highlight everything except the header.

For counting, COUNTIF with a "<>" criterion often does the job without NOT. NOT earns its place around ISBLANK and around AND, and inside conditional formatting rules, where a formula like =NOT(ISBLANK($B2)) highlights every row with a value in column B.

If a condition gets tangled, remember that NOT(AND(a,b)) is the same as OR(NOT(a),NOT(b)).

NOT questions

What does NOT do in Excel?
It reverses a logical value: NOT(TRUE) is FALSE and NOT(FALSE) is TRUE.
What is the difference between NOT and <>?
For a simple comparison they are equivalent. NOT can also wrap functions such as ISBLANK or AND.
How do I say a cell is not empty?
=NOT(ISBLANK(A2)) or =A2<>"".
Does NOT work with numbers?
Yes. Zero is treated as FALSE and any other number as TRUE.

Practice NOT

The lesson OR and NOT (module 7 of Everyday Excel) has checked NOT exercises. It is part of Full Access; only the first two lessons of each module are free. The free 5-item sample test uses the same kind of formulas in a working grid if you want to try before you decide.

Try a 5-item Excel test sample