Example

One common use for the NOT function is to expand the usefulness of other functions that perform logical tests. For example, the IF function performs a logical test and then returns one value if the test evaluates to TRUE and another value if the test evaluates to FALSE. By using the NOT function as the logical_test argument of the IF function, you can test many different conditions instead of just one.

Syntax

NOT(logical)

The NOT function syntax has the following arguments:

Logical Required. A value or expression that can be evaluated to TRUE or FALSE.

Remarks

If logical is FALSE, NOT returns TRUE; if logical is TRUE, NOT returns FALSE.

Examples

Here are some general examples of using NOT by itself, and in conjunction with IF, AND and OR.

Formula

Description

=NOT(A2>100)

A2 is NOT greater than 100

=IF(AND(NOT(A2>1),NOT(A2<100)),A2,"The value is out of range")

50 is greater than 1 (TRUE), AND 50 is less than 100 (TRUE), so NOT reverses both arguments to FALSE. AND requires both arguments to be TRUE, so it returns the result if FALSE.

=IF(OR(NOT(A3<0),NOT(A3>50)),A3,"The value is out of range")

100 is not less than 0 (FALSE), and 100 is greater than 50 (TRUE), so NOT reverses the arguments to TRUE/FALSE. OR only requires one argument to be TRUE, so it returns the result if TRUE.

Sales Commission Calculation

Here is a fairly common scenario where we need to calculate if sales people qualify for a bonus using NOT with IF and AND.

=IF(AND(NOT(B14<$B$7),NOT(C14<$B$5)),B14*$B$8,0)- IF Total Sales is NOT less than Sales Goal, AND Accounts are NOT less than the Account Goal, then multiply Total Sales by the Commission %, otherwise return 0.