Sub topic 4
Finding the mean with AVERAGE
This chapter assumes you can enter values in cells, select ranges, and start a formula with an equals sign. It also assumes you know SUM from the previous chapter. AVERAGE returns the arithmetic mean of the numbers it reads.
What AVERAGE does
AVERAGE adds the numeric cells in its arguments and divides by how many numeric cells it found. The syntax matches SUM: one or more arguments, each a cell, a range, or a constant.
=AVERAGE(B2:B6)If B2:B6 holds 10, 20, 30, 40 and 50, the result is 30, because 150 divided by 5 is 30.
AVERAGE is SUM divided by COUNT
The two formulas below return the same value. This equivalence is the working model for the rest of the chapter.
=AVERAGE(B2:B6)
=SUM(B2:B6)/COUNT(B2:B6)The divisor is COUNT, the number of numeric cells. It is not the number of cells in the range. Keep this in mind whenever an average looks wrong. The usual cause is a different count than you expected.
What gets skipped
Blank cells and text in a referenced range are ignored. They do not count as zero, and they do not enter the divisor. A cell holding the number 0 is a real value, so it is included.
| B2:B6 contents | Sum | Count | AVERAGE |
|---|---|---|---|
| 10, 20, 30, 40, 50 | 150 | 5 | 30 |
| 10, 20, blank, 40, 50 | 120 | 4 | 30 |
| 10, 20, 0, 40, 50 | 120 | 5 | 24 |
| 10, 20, "n/a", 40, 50 | 120 | 4 | 30 |
The second and third rows show the difference between a missing value and a zero. Decide which one your data means. A student who did not sit an exam should usually be blank. A student who scored zero should be 0.
Logical values and text typed directly as arguments are treated differently from those inside a range. This chapter covers that distinction in the later section on data types.
Averaging several arguments
Like SUM, AVERAGE accepts several arguments. All numeric values are pooled and divided by the total count.
=AVERAGE(B2:B6, D2:D6)This is the mean of all ten values together. It is not the mean of two means. If the ranges have different numbers of numeric cells, the two results differ.
Common errors
- #DIV/0!. The range contains no numbers, so the divisor is zero. This happens with an empty range, or one that holds only text. The next chapters show how to guard against it.
- Numbers stored as text. Values that were pasted or imported may look numeric but be text.
AVERAGEskips them silently, and the result looks plausible but is wrong. CompareCOUNTwithCOUNTAover the same range. If they differ, some cells are not numeric. - An error inside the range. If any cell holds an error such as #N/A,
AVERAGEreturns that error. - Averaging a total row. If the range includes a subtotal or grand total row, the total is counted as a data point and skews the mean.
Worked example
Suppose B2:B6 holds quiz scores 8, 6, 9, blank, and 7. The blank is a student who has not yet taken the quiz.
=AVERAGE(B2:B6)
=SUM(B2:B6)/COUNT(B2:B6)Both return 7.5, which is 30 divided by 4. If you typed 0 in the blank cell, the average would fall to 6, which is 30 divided by 5.
Exercise
B2:B6 contains 4, 6, the text "absent", 10 and an empty cell. What does =AVERAGE(B2:B6) return, and which divisor does it use?
Show answer
It returns about 6.67. The sum of the numeric cells is 20, and the divisor is 3, the count of numeric cells. The text and the empty cell are skipped.
Exercise
A column of imported scores gives =COUNTA(B2:B21) as 20 but =COUNT(B2:B21) as 17. What does this suggest about =AVERAGE(B2:B21)?
Show answer
Three non-empty cells are not numeric, most likely numbers stored as text. AVERAGE ignores them, so it averages only 17 values and may not reflect the full data.