Excel functions / Logical

Comparison operators

Compare two values with =, <>, >, <, >= and <=, returning TRUE or FALSE.

At a glance

=Equal to.
<>Not equal to.
>Greater than.
<Less than.
>=Greater than or equal to.
<=Less than or equal to.

How it works

Comparison operators ask a yes-or-no question about two values. =B2>=50 returns TRUE or FALSE on its own, and the same comparison is the test inside IF, COUNTIF and every other conditional function.

Text comparisons ignore case, so "yes" equals "Yes". Inside COUNTIF and SUMIF, the operator goes in quotes with the value: =COUNTIF(B2:B4,">=50").

Example

E3=B3>=50
ABCDE
1StudentScoreAttended
2Ana72Yes
3Ben45YesFALSE
4Cal88No
5

Result: FALSE. Ben's 45 is not at least 50.

Tips

Practise Comparison operators

Try it yourself in a real spreadsheet, with instant feedback on every answer.

Start the exercise

Related