Simple inequality operator (!=)

Value1 != Value2

Value1

The first value to compare.

Value2

The second value to compare.

Returns — Logical

Whether the first value is not equal to the second value.

Returns whether the first value is not equal to the second value. 2 != 32 != 3 returns TRUE, but 2 != 22 != 2 returns FALSE. "a" != "A""a" != "A" returns TRUE, because text string comparisons are case-sensitive (unlike the <> operator, where text string comparisons are case-insensitive.)

Array behavior

When applied to arrays, this operator returns a single TRUE or FALSE value indicating whether their elements are not identical.

This formula returns FALSE:

{ 2, 2 } != { 2, 2 }{ 2; 2 } != { 2; 2 }

This formula returns TRUE:

{ 2, 2 } != { 2, 3 }{ 2; 2 } != { 2; 3 }

The <> operator works differently. This formula returns the array { FALSE, FALSE }{ FALSE; FALSE }:

{ 2, 2 } <> { 2, 2 }{ 2; 2 } <> { 2; 2 }

This formula returns the array { FALSE, TRUE }{ FALSE; TRUE }:

{ 2, 2 } <> { 2, 3 }{ 2; 2 } <> { 2; 3 }

The behavior of the <> operator is useful particularly when used with the FILTER function. Refer to the <> documentation for more information.

Examples

2 != 32 != 3

Returns TRUE.

2 != 22 != 2

Returns FALSE.

"a" != "A""a" != "A"

Returns TRUE. Text string comparisons are case-sensitive.

"a" <> "A""a" <> "A"

Returns FALSE, as the <> operator compares text strings in a case-insensitive manner.

"a" != "a""a" != "a"

Returns FALSE. Text string comparisons are case-sensitive.

{ 2, 2 } != { 2, 2 }{ 2; 2 } != { 2; 2 }

Returns FALSE, because all pairs in the two arrays are equal to one another.

{ 2, 2 } != { 2, 3 }{ 2; 2 } != { 2; 3 }

Returns TRUE, because not all pairs in the two arrays are equal to one another.