Comparisons: TRUE and FALSE

Managers who sold $100,000 or more get a bonus. In a table of five rows, you can spot them by eye. But a real table has hundreds of rows, and it's easy to mistake 99,900 for 100,000 there.

You can hand this check over to Excel. You ask it a question: are the sales in this row at least 100,000? In a formula, a question like this is called a comparison:

=B2>=100000

The >= sign means "greater than or equal to". A comparison answers with neither a number nor text, but with a logical value. There are only two of them: TRUE if the statement is true, and FALSE if it isn't.

fx
A
B
C
D
1
2
3
4
5
6
7
8
Manager
Sales, $
Target met
Emma
124000
Ben
87500
Olivia
100000
Leo
99900
Mia
143000
Sheet1

Six signs

Besides >=, Excel has five more comparison signs. Some let through numbers above the boundary, others numbers below it, and the boundary itself fits for some signs but not others. Switch the sign above the axis: the shaded band shows which sales fit, and a filled circle at 100,000 means the boundary itself fits too.

=B2>=100000greater than or equal to
87,500BenFALSE
99,900LeoFALSE
100,000OliviaTRUE
124,000EmmaTRUE
Everything to the right of the boundary fits, and so does the boundary itself. This is the sign for "100,000 or more".

Two-character signs are typed without a space, with the angle bracket first: >=, <=, <>.

The first = in a formula, as usual, marks its start. In the formula =B2=100000, the second = compares B2 with 100,000.

Comparing text

You can compare words too, for example to check whether an order came from Boston. The word you compare with goes in straight quotes: =B2="Boston". The quotes tell Excel that this is text and not a cell address.

fx
A
B
C
D
1
2
3
4
5
6
7
Order
City
From Boston
#101
Boston
#102
Denver
#103
boston
#104
Austin
Sheet1

The <> sign works with text too: =B2<>"Boston" answers TRUE for any city except Boston.