Course / Logic & Decisions

Comparisons: TRUE or FALSE

Ask yes/no questions about your data with =, <>, <, >, <= and >=. Beginner · 4 min · = and <>, < > <= >=, TRUE/FALSE

A comparison asks a yes/no question about your data, and the answer is always TRUE or FALSE. There are six comparison operators:

So =B2<C2 reads as "is B2 less than C2?". On their own, comparisons make handy flags. Inside IF, AND and COUNTIF they drive every decision a spreadsheet makes.

Steps

  1. A plant needs reordering when its stock is at or below its reorder level. In E2, type =B2<=C2, then copy it down to E7.

  2. Which plants come from the Fernhill nursery? In F2:F7, compare each supplier with the text Fernhill. Text inside a formula needs double quotes: =D2="Fernhill"

  3. In G2:G7, flag the plants you can sell today: their stock is not equal to 0. Use the <> operator.

  4. Everything is heading to a weekend market. In B10, check whether the total stock is greater than the stall capacity in B9. Either side of a comparison can be a calculation, so you can start with a SUM.

Remember

Previous: Percentages and number formats · Next: The IF function