1. Lighthouse

Level 2 · Summarise the lighting range

The request

From Jessica Turner, Merchandising Manager

“We're repricing the lighting range next week. Before the meeting, can you give me four numbers from the catalog: the prices added up, the average price, the cheapest and the most expensive?”

Your goal

In G2:G5, use functions over the price column D2:D21: G2 the total of all prices (SUM), G3 the average price (AVERAGE), G4 the lowest price (MIN), G5 the highest price (MAX).

  • Fill G2:G5 with the right valuesnot done yet
  • With formulas, not typed numbersnot done yet
  • Use SUM AVERAGE MIN MAXnot done yet

Your sheet

Excel
The sheet for this level
ABCDEFGH
1product_idnamesubcategoryunit_priceMeasureValue
2121Bramble Ceramic Floor LampFloor Lamps31.99Total of all prices
3122Monroe Glass Desk LampTable Lamps29.99Average price
4123Sutton Brass ChandelierPendants30.99Cheapest
5124Marlow Glass Wall SconceSconces349.00Most expensive
6125Pacifica Black Metal Arc LampFloor Lamps279.00
7126Fern Rattan Desk LampTable Lamps379.00
8127Dune Black Metal Pendant LightPendants189.00
9128Delancey Black Metal Wall SconceSconces54.99
10129Dune Ceramic Arc LampFloor Lamps109.00
11130Pacifica Black Metal Table LampTable Lamps409.00
12131Ashford Linen Pendant LightPendants349.00
13132Fairhaven Brass Wall SconceSconces189.00
14133Dune Black Metal Floor LampFloor Lamps51.99
15134Sable Linen Table LampTable Lamps92.99
16135Ridge Ceramic ChandelierPendants159.00
17136Quarry Rattan Picture LightSconces159.00
18137Marlow Linen Floor LampFloor Lamps219.00
19138Oakley Brass Table LampTable Lamps199.00
20139Rowan Ceramic ChandelierPendants189.00
21140Quarry Ceramic Picture LightSconces329.00
22
23

Loading the editor…

    ResultPress Check to compare G2:G5

    Mote checks your result

    Press Check. Each right cell becomes a firefly in your lantern.

    The lesson

    Adding twenty prices with =D2+D3+D4+… works, but it is long, easy to break, and does not grow when rows are added. Functions do this work for you. A function has a name, then its inputs in brackets:

    =SUM(D2:D21)

    Ranges

    D2:D21 is a range: every cell from D2 down to D21, written as the first cell, a colon and the last cell. A range can be a column (D2:D21), a row (B2:F2) or a block (B2:D21). Click a cell in the sheet and the formula bar shows which one you are in; selecting from D2 to D21 with Shift+click shows the range in the name box on the left.

    The four everyday summaries

    Function What it returns
    =SUM(D2:D21) all the numbers added up
    =AVERAGE(D2:D21) the sum divided by how many numbers there are
    =MIN(D2:D21) the smallest number
    =MAX(D2:D21) the largest number

    On the lighting range, MIN and MAX tell Jessica the price span at a glance: from 29.99 up to 409.00. The average sits far above the cheapest items, because a few expensive pieces pull it up. That is worth saying out loud in a pricing meeting: an average describes the range, not a typical product.

    What functions skip

    SUM, AVERAGE, MIN and MAX look only at numbers inside a range. Text and empty cells are ignored. That is convenient (the header unit_price in D1 would be skipped even if you included it) and also a trap:

    • an empty cell is left out of AVERAGE, which is usually what you want: an unknown price is not a price of zero;
    • a cell holding 0 is included, and drags the average down;
    • a number stored as text (often from a messy export, shown left-aligned) is skipped by all four, so totals come out too low without any error.

    When a total looks low, check that every value in the column is right-aligned. Numbers align right, text aligns left.

    Typing functions

    Function names are not case-sensitive: =sum(d2:d21) is accepted and Excel rewrites it as =SUM(D2:D21). While you type a formula, you can click a cell to insert its address instead of typing it.

    Common mistakes

    • Including the header or a total row in the range. A range like D2:D22 that also covers a total in row 22 counts that total twice.
    • Stopping the range early. D2:D20 misses the last product. Check the last row number.
    • Typed numbers. Copying the result of a calculator into G2 gives the right number today and a stale one next week. The checker asks for formulas.
    • Writing =SUM(D2+D21). The plus adds just two cells. A range needs the colon.

    Pick what may run on this site. You can change this any time from "Cookie settings" at the bottom of every page.