Operator <>

Return TRUE if the values are different (not equal), FALSE otherwise

Usage

left_value <> right_value

Parameters

left_value

(Required) Value to compare

right_value

(Required) Value to compare

Examples

Example With these variables Result

price <> 9.5

price is 9.5

FALSE

age1 <> age2

age1 is 22
age2 is 25

TRUE

word <> “hello”

word is "hello"

FALSE

word <> “moon”

word is "hello"

TRUE

word <> “case insensitive”

word is "CASE INSENSITIVE"

FALSE

word1 <> word2

word1 is " extra space ignored "
word2 is "extra space ignored"

FALSE

word <> 42.9

word is "hello"

TRUE

date1 <> date2

date1 is DATE(2022, 1, 2)
date2 is DATE(2022, 1, 2)

FALSE

“123” <> 123

(None)

TRUE

More information

If the values are of different types, such as a text and a number, the result is TRUE.

This operator is case insensitive, so “A” is considered equal to “a”. Use the EXACT function with the NOT function if you need case sensitivity.

Unlike Excel, this operator also runs TRIM on the texts it receives. With Word’s formatting, it’s quite easy to accidentally have double spaces or spaces between the quotes and the text. Using TRIM automatically means that "hello world" is considered equal to "  hello   world  ", but not to "helloworld". Use the EXACT function with the NOT function if you don’t want this automated TRIM.

See also