Operator =

Return TRUE if the values are 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

TRUE

age1 = age2

age1 is 22
age2 is 25

FALSE

word = “hello”

word is "hello"

TRUE

word = “moon”

word is "hello"

FALSE

word = “case insensitive”

word is "CASE INSENSITIVE"

TRUE

word1 = word2

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

TRUE

word = 42.9

word is "hello"

FALSE

date1 = date2

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

TRUE

“123” = 123

(None)

FALSE

More information

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

This operator is case insensitive, so “A” is considered equal to “a”. Use the EXACT 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 if you don’t want this automated TRIM.

See also