Skip to content

Formula sheet

Write SUMIF and VLOOKUP in a small sheet, copy them down and check them two ways.

What this lab shows

A formula written by AI can look right and give the wrong number. In this small sheet, with the made-up sales of a bakery, you paste or type the formula, see the cells each part reads, follow what happens to the dollar signs when you copy down and check the result against the hand calculation.

Made-up data. The lab understands six functions and imitates spreadsheet rules for them.

How to use it

  1. Start with the book's formula and change the row to see how it looks in B3 and B4.
  2. Remove the dollar signs and turn on "change the order of the rows": the result that looked right breaks.
  3. In the price exercise, compare VLOOKUP with and without dollar signs, with IFERROR and without FALSE.
LabFormula sheetTry it

Illustrative dataMade-up bakery data. The formulas are computed by a small interpreter built for this lab, which imitates Excel's and LibreOffice's rules for these six functions.

The bakery's sales sheet and the total by category computed with the book's formula.

DateProductCategoryQuantityPriceTotal
11/02Brigadeirosweets123.5042.00
11/02Carrot cakecakes145.0045.00
11/03Brigadeirosweets203.5070.00
11/03Lemon piepies152.0052.00
11/04Carrot cakecakes245.0090.00
11/04Beijinhosweets153.5052.50
11/05Lemon piepies152.0052.00
11/05Chocolate cakecakes148.0048.00

=SUMIF(Sales!$C$2:$C$9, A2, Sales!$F$2:$F$9)

  • sweets: 164.50
  • cakes: 183.00
  • pies: 104.00
What to notice: A formula that is right with this order of the data can be wrong with the next one. Checking two ways, the sum of the categories against the direct sum, catches the error no one would see by looking at a single number.

Books that use this lab

No published book uses this lab yet.