TRUE, FALSE and the Question Behind Them
About this lesson
A comparison such as B2>B8 is a formula that returns TRUE or FALSE. Every IF, COUNTIF and filter in Excel is built on one.
- write a comparison that returns TRUE or FALSE.
- compare text as well as numbers, and add up a column of flags.
- say whether a value on the line counts as above it.
The idea
Before IF, there is the question IF asks. A comparison on its own is a complete formula: an equals sign, one cell, a sign, another cell. It returns TRUE or FALSE with nothing around it. A column of them is a column of flags. TRUE is 1 and FALSE is 0 underneath, so adding the column counts the flags.
The edge is the thing to be exact about. Greater-than does not include equal. So a reading exactly on a limit is not above it. Most arguments about a report's flags are arguments about which sign the rule meant.
The mistake to watch for
Treating at-or-above as above. A comparison is exact about its edge. A reading equal to the maximum is not above it. So a rule that means at or above needs >=. A rule written with > lets the boundary case through. Decide what the boundary means before you pick the sign.
Read more about this
Where this comes up again
This lesson needs JavaScript to run. Everything below is the lesson in full, but you cannot type into the grid or be marked.
A comparison asks a yes-or-no question and answers TRUE or FALSE.
In D2, type:
=B2>B8
B8 is the safe maximum for this fridge.
| Row | A | B | C | D | E | F | G |
|---|---|---|---|---|---|---|---|
| 1 | Date | Temp C | Checked by | ||||
| 2 | Mon 6 Jan | 4.2 | R Okafor | ||||
| 3 | Tue 7 Jan | 5.1 | R Okafor | ||||
| 4 | Wed 8 Jan | 8.6 | L Hastie | ||||
| 5 | Thu 9 Jan | 3.9 | L Hastie | ||||
| 6 | Fri 10 Jan | 7.4 | R Okafor | ||||
| 7 | |||||||
| 8 | Safe maximum | 8 |
Every step
-
A comparison asks a yes-or-no question and answers
TRUEorFALSE. InD2, type:=B2>B8.B8is the safe maximum for this fridge. -
Read
=B4>B8and say what it returns. Wednesday's reading is 8.6. -
In
D5, ask the same question about Thursday. -
TRUEandFALSEare numbers underneath:TRUEis 1 andFALSEis 0. InD6, addD2andD4with a plus sign. See what number comes out. -
Comparisons work on text too. A single = sign checks whether two things match. In
D8, ask whether Monday and Tuesday were checked by the same person. -
Suppose Tuesday's reading had been exactly 8, the maximum itself. Read
=B3>B8withB3at 8 and say what it returns.