說明
Use this function to reverse the logic of an argument. It returns TRUE if the argument is FALSE, and FALSE if the argument is TRUE. Supported in Chains.
語法
NOT(logical)
Inputs
This function accepts the following argument:
名稱 | 必要 | 說明 | Valid input |
---|---|---|---|
logical |
是 | A value or expression that can be evaluated to TRUE or FALSE. | A cell reference, a logical value (TRUE or FALSE), a number (0 is FALSE, other numbers are TRUE), or a formula which results in any of these. |
範例
範例資料
A | B |
---|---|
TRUE | 5 |
FALSE | 0 |
10 | 20 |
Apple | Banana |
Sample formulas
公式 | 說明 | 結果 |
---|---|---|
=NOT(A1) |
Returns the opposite of the logical value TRUE in A1. | FALSE |
=NOT(A2) |
Returns the opposite of the logical value FALSE in A2. | TRUE |
=NOT(B1>10) |
Evaluates if B1 (5) is greater than 10, then returns the opposite. | TRUE |
=NOT(A3=B3) |
Checks if A3 (10) is equal to B3 (20), then returns the opposite. | TRUE |
=NOT(ISTEXT(A4)) |
Checks if A4 contains text, then returns the opposite. | FALSE |
附註
- This function is often used in combination with other logical functions, such as AND, OR, and IF.
- When used with non-boolean values, NOT converts its argument to a boolean before negating it.
-
NOT(0)
returns TRUE, while NOT of any other number returns FALSE. -
NOT("FALSE")
returns FALSE because the text "FALSE" is considered TRUE.
提示
- Use NOT to invert complex conditions, making them easier to understand.
- Combine NOT with comparison operators to create "not equal to" conditions. For example:
NOT(A1=B1)
is equivalent toA1<>B1
. - When using NOT with other logical functions, be aware of De Morgan's laws for simplifying complex logical expressions.
- NOT can be used to check for non-blank cells; for example:
NOT(ISBLANK(A1))
. - In conditional formatting, NOT can be useful for highlighting cells that don't meet certain criteria.