TopicsCheat sheetLessons
Lurndo › Excel › Comparisons

Learning Excel: Comparisons

Comparing

Dave puts a cup of coffee down on the edge of the front desk. "Who's under 12? Who has an annual pass? Can't Excel just tell me?" It can: with a comparison.

TRUE or FALSE

A comparison asks a question whose answer is TRUE or FALSE. =B2>=12 asks: is Jack 12 or older?

Jack is 9, so H2 shows FALSE. An answer like that is called a logical value. It isn't text, but a kind of value of its own.

H2
fx

=B2>=12

ABCDEFGH
1NameAgePassVisitsPaidCategoryPer visit
2Jack9Single3£15.00FALSE
3Nora34Annual22£240.00
4Mila15Monthly9£25.00
5Rita67Annual15£240.00
6Laura41Single£10.00
7Rory7Monthly6£25.00
8Jim72Annual18£240.00
9Will28Single4£20.00
10Hannah12Monthly11£25.00
11Sara55Annual0£240.00
12

The operators

You compare with = (equal to), <> (not equal to), < and > (less than and greater than), and <= and >= (less than or equal to, greater than or equal to).

You compare text in quotation marks: =C2="Single". Upper and lower case don't matter.

Watch out for Hannah: her age sits on the left of the cell, because someone typed it as text. To Excel, text is always greater than any number.

ABCDEFG
1NameAgePassVisitsPaidCategoryPer visit
2Jack9Single3£15.00
3Nora34Annual22£240.00
4Mila15Monthly9£25.00
5Rita67Annual15£240.00
6Laura41Single£10.00
7Rory7Monthly6£25.00
8Jim72Annual18£240.00
9Will28Single4£20.00
10Hannah12Monthly11£25.00
11Sara55Annual0£240.00
12

Try it yourself

Does Nora have an annual pass? Make H3 say so with a comparison.

ABCDEFGHI
1NameAgePassVisitsPaidCategoryPer visit
2Jack9Single3£15.00
3Nora34Annual22£240.00
4Mila15Monthly9£25.00
5Rita67Annual15£240.00
6Laura41Single£10.00
7Rory7Monthly6£25.00
8Jim72Annual18£240.00
9Will28Single4£20.00
10Hannah12Monthly11£25.00
11Sara55Annual0£240.00
12
H3

Ready for more?

The full lesson has 5 exercises, from easy to challenging, with hints, points and a streak you can build.

Start the lesson
← PreviousLocking just halfNext →Choosing with IF

SQL

  • Topics
  • All lessons
  • Cheat sheet

Excel

  • Topics
  • All lessons
  • Shortcuts

HTML & CSS

  • About the course
  • All lessons

Lurndo

  • Dashboard
  • Leaderboard
  • Premium
  • Account
  • Privacy
Nederlands