Excel spreadsheets · 2 / 5

Functions that do the counting

Today you will use functions to total, average and count a column in one step, share a total as a percentage, and read the error messages when a formula goes wrong.

pioneers 75 min

Functions that do the counting

Today you will use functions to total, average and count a column in one step, share a total as a percentage, and read the error messages when a formula goes wrong.

Teacher block: The total that did not match

Apio adds up Monday’s sales by hand. She gets 127,500. Her cousin types the same numbers into a spreadsheet and gets 172,500.

One of them is wrong. Which one, and how could you find out?

Teacher block: Recall from yesterday and last week

Answer on paper, then check with a neighbour.

  1. What sign must every formula start with?
  2. Cell B2 holds 20 and C2 holds 3000. What does =B2*C2 show?
  3. You copy that formula down one row. What does the new formula say?
  4. Write a path for a file called Shop week in your University folder.

Teacher block: Katherine Johnson checks the computer

In 1962 NASA was about to send John Glenn round the Earth in a spacecraft. Electronic computers had worked out his flight path. Glenn did not fully trust the machine. He asked for Katherine Johnson, a mathematician at NASA, to check the numbers by hand. He said he would go if she said they were right.

She had done such calculations for years, with a pencil and a mechanical calculator. Her check was the same kind of habit you will practise today: do the work a second way.

When did a second check last save you from a wrong answer?

Teacher block: Functions and ranges

A function is a ready-made formula with a name. You give it some cells, and it does the work.

A range is a block of cells. Write it with a colon between the first and last cell: F2:F6 means F2, F3, F4, F5 and F6.

Function What it does Example
SUM Adds the numbers =SUM(F2:F6)
AVERAGE Adds, then divides by how many numbers =AVERAGE(F2:F6)
MIN The smallest number =MIN(F2:F6)
MAX The biggest number =MAX(F2:F6)
COUNT How many cells hold numbers =COUNT(F2:F6)
COUNTA How many cells are not empty, words or numbers =COUNTA(A2:A6)

Write the function name, an open bracket, the range, a close bracket.

Try it on this page. In this practice grid the totals are in column B, not F. B7 already holds =SUM(B2:B6). Type =AVERAGE(B2:B6) in B8, then MIN, MAX and COUNT below it. Predict each answer first. The grid has SUM, AVERAGE, MIN, MAX and COUNT. For COUNTA, the dollar sign and the other functions you need Excel or Calc.

Pretend spreadsheet

Click a cell, then type. Start with = to do a sum, for example =B2*2.

A1
A
B
1
2
3
4
5
6
7
8
9
10
11
Which function?Card 1 of 6

Think of the answer first. Then turn the card.

Teacher block: Locking a cell with the dollar sign

Sometimes a formula must keep looking at the same cell when it is copied down. For example, each item’s share of the total always divides by the same total cell.

The dollar sign locks part of an address. This is an absolute reference.

Written Meaning
B2 Relative. Moves when copied.
$B$2 Absolute. Column and row both locked. Never moves.

Percentage of total is the part divided by the whole:

=B2/$B$5

When copied down, the first part (B2) moves to B3 and B4. The second part ($B$5) stays.

On a computer, show the answer as a percentage with the percent format. The number 0.338 shows as 33.8%.

Teacher block: Errors are messages

When a formula cannot give an answer, the cell shows an error. It is not a disaster. It is the program telling you what went wrong.

You see Meaning Usual cause and fix
##### The number does not fit in the column Make the column wider
#DIV/0! Divided by zero or by an empty cell Check the cell you divide by. Lock it with dollars if needed
#NAME? The program does not know a word in the formula A function name is spelled wrong. Check the spelling
#VALUE! The formula tried to use words as numbers A cell that looks like a number is text
#REF! The formula points at a cell that was deleted Undo the deletion, or write the formula again

LibreOffice Calc sometimes shows a number code instead of the name, for example Err:508 for a missing bracket. Click the cell and look at the message at the bottom of the screen.

Match the error to its usual cause0 of 5 matched

Click one on the left, then its partner on the right.

Teacher block: Predict first

On paper, no laptop yet.

Predict first, TuesdayName:

Name:

The Total column holds these: F2 is 60000, F3 is 67500, F4 is 50000, F5 is 54000, F6 is 30000. A2 to A6 hold words.

  1. What does =SUM(F2:F6) show?

  2. What does =MAX(F2:F6) show?

  3. What does =AVERAGE(F2:F6) show?

  4. What does =COUNTA(A2:A6) show?

  5. What does =COUNT(A2:A6) show?

  6. A cell shows #DIV/0!. What kind of mistake is it?

  7. In =B2/$B$5, which cell is locked?

  8. Which would you check first: a wrong total, or a total that is close but not exact? In one sentence, say how you would check a total by a second route.

    Your teacher will read this answer. Choose who is learning (top of the page) to save this answer.

Teacher block: Quick check

Functions and errorsQuestion 1 of 4

Which formula adds the numbers in F2 to F13?

Teacher block: Estimate before you trust

Reasoning with data. Look at the five totals again. Without adding them exactly, say a number the total must be close to. Say how you got it.

Laptop block: Totals, averages and counts

No teacher is with you. Follow the numbers. Work in pairs, or alone if you are the only Pioneer. Swap driver and navigator after about 5 minutes.

  1. Open Excel, or LibreOffice Calc, which is free. Open your file Shop week from University, Spreadsheets. If it is lost, type the data again from Monday’s lesson.
  2. Click A15 and type Total sales (UGX). Click F15 and type =SUM(F2:F13). Press Enter. Row 14 stays empty on purpose.
  3. Predict first, then check. The answer should be 502500. If you get something else, click F2 and check that F2 down to F13 all hold formulas.
  4. Fill in the rest of the summary in this way. Type the label in column A and the formula in column C or F as shown:
Label in column A Cell Formula to type Result
Total sales (UGX) F15 =SUM(F2:F13) 502500
No new label: C15 is in the Total row, under Quantity C15 =SUM(C2:C13) 209
Average sale (UGX) F16 =AVERAGE(F2:F13) 41875
Smallest sale (UGX) F17 =MIN(F2:F13) 20000
Biggest sale (UGX) F18 =MAX(F2:F13) 67500
Number of sales F19 =COUNT(F2:F13) 12
Items named F20 =COUNTA(A2:A13) 12
  1. Now make the share column. In G1 type the heading Share. In G2 type =F2/$F$15. Press Enter. Fill down from G2 to G13 with Ctrl + D (Command + D).
  2. Make G2 to G13 show percent. Select them. Press the % button, or open Format Cells with Ctrl + 1 (Command + 1), choose Percent, and choose 1 decimal place. In Excel the % button is on the Home tab. In Calc, it is on the Formatting toolbar, or use Format, Cells.
  3. Check. G2 should be 11.9%. G3 should be 13.4%. Add the whole column: put =SUM(G2:G13) in G15. It should be 100.0%.
  4. Save with Ctrl + S (Command + S).

Expected shares:

Row Item Share
2 Posho 11.9%
3 Beans 13.4%
4 Sugar 10.0%
5 Cooking oil 10.7%
6 Soap bar 6.0%
7 Airtime card 6.0%
8 Exercise book 7.5%
9 Pen 4.0%
10 Posho 10.7%
11 Paraffin 6.4%
12 Beans 9.0%
13 Exercise book 4.5%
Check my results, TuesdayName:

Name:

  1. What does F15 show?

  2. What does F16, the average, show?

  3. What does F18, the biggest sale, show?

  4. What does F20 show, and what is its function?

  5. What does G3 show?

Laptop block: Make the errors on purpose

Add a new sheet for practice, so that your Shop week sheet stays safe. In Excel, click the plus beside the sheet name at the bottom. In Calc, use Sheet, Insert Sheet at End.

  1. In A1 type the word Posho and in B1 type 5. In C1 type =A1+B1. Press Enter. Which error? (#VALUE!, because A1 is a word.)
  2. In D1 type =SUMM(B1). Which error? (#NAME?)
  3. In E1 type =B1/0. Which error? (#DIV/0!)
  4. In B3 type the number 502500. Drag the line between the B and C headings to make column B very narrow. Which symbol? (#####). Double-click the line to make it fit.
  5. In A5 type 4 and in B5 type 6. In C5 type =A5+B5. It shows 10. Now delete column A: right-click the A heading and choose Delete. Which error appears in the cell that used to be C5? (#REF!). Press Ctrl + Z (Command + Z) to undo it.
  6. Write each error and its cause on your Error card.
Error cardsName:

Name:

What I typed What I saw What it means
=A1+B1 with a word in A1
=SUMM(B1)
=B1/0
A big number in a narrow column
A deleted column

Laptop block: Challenges

Bronze

Find the average quantity sold per sale. In C16 type =AVERAGE(C2:C13). The answer is 17.41666667 or similar. Format it to show one decimal place: 17.4.

Silver

Show how many sales were worth more than the average. Write what you predict first. In F21 try =COUNTIF(F2:F13,">41875"). The answer should be 6. Write one sentence on what the formula does.

Gold

Make the average formula check itself. In F22 type =F15/F19. Compare it with F16. They must be equal. Then explain to your partner why both are true: an average is a total divided by a count.

Laptop block: Exit question

Write on paper, then say one sentence aloud to your partner.

A cell shows #DIV/0! after you copy a formula down. What do you check first?

Laptop block: Home mission

Paper (no device). For seven days, write what you spend each day on paper. At the end of the week, work out by hand: the total, the average per day, the biggest day, and each day’s share of the total. Write the formulas you would type.

Phone (if you have one free). Open the calculator on your phone. Check the SUM and the average you worked out for the five totals in class: 261500 and 52300. Write down the steps.

Laptop block: Prepare tomorrow's mentoring

Tomorrow the Explorers do Drawing with the computer. Today they typed words, spaces and capital letters. Tomorrow they use the drawing pad on the site (the lesson calls it the DrawPad): brush, line, box, circle, rubber, colours, undo, clear, and “Save my picture”. First they draw a hut, a mango tree and the sun together. Then each learner chooses their own name in “Who is learning?”, draws their own home, and clicks Save my picture.

Know where the picture goes. The browser downloads it as a picture file named with the learner’s name, the word picture and the date, for example Akello-picture-2026-12-09.png. It usually goes to the Downloads folder with no question. If the browser is set to ask, a save box opens. Try it once on each laptop before class.

Write on a sheet:

  1. The first thing you will say. For example: “What would you like to draw?”
  2. Two words you will use in plain English. For example “brush” and “undo”.
  3. The question you will ask instead of taking the mouse: “What do you think will happen if you press here?”

Practise with your partner. One of you is the Explorer, the other is the mentor. The mentor sits with hands behind the back.

I can...

Pick your name first, at the top of the page.

← Cells, rows, and your first formulasTables: sort, filter, and decide →

Use the arrow keys