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 have met SUM and the idea of a function call with arguments. Here you will learn exactly what AVERAGE computes, which cells it skips, and why a result can look wrong even when the formula is correct.
What AVERAGE returns
AVERAGE returns the arithmetic mean: the sum of the numbers divided by how many numbers there are.
=AVERAGE(B2:B6)The key detail is the word "numbers". AVERAGE does not divide by the number of cells in the range. It divides by the count of cells that hold numeric values. That is why these two formulas always return the same value:
=AVERAGE(B2:B6)
=SUM(B2:B6)/COUNT(B2:B6)The second form is a useful mental model. Whenever AVERAGE surprises you, ask what SUM and COUNT would return for the same range.
A worked example
Suppose B2:B6 holds quiz scores for five students:
| Cell | Content | Treated by AVERAGE as |
|---|---|---|
| B2 | 80 | Number, included |
| B3 | 90 | Number, included |
| B4 | (empty) | Skipped |
| B5 | absent (text) | Skipped |
| B6 | 0 | Number, included |
The numeric cells are B2, B3, and B6. Their sum is 170 and their count is 3, so =AVERAGE(B2:B6) returns 56.6667 (displayed rounded, depending on the cell format).
Three things follow from this one table:
- The empty cell B4 and the text in B5 do not pull the average down. They are not counted as zeros.
- The 0 in B6 does pull it down. A real zero is a number.
- If the student in B6 had not taken the quiz and the cell were left empty, the result would be 85, not 56.6667.
Whether a missing score should be a blank or a zero is a decision about your data, not about Excel. AVERAGE simply reports what the cells contain.
How AVERAGE decides what to include
Each cell in a range reference passes through the same checks.
The next sections cover each branch in more detail.
Blanks, text, and logical values in ranges
When a value comes from a cell reference, AVERAGE keeps only true numbers. It skips:
- Empty cells.
- Text, including an empty string returned by a formula such as
="". - Logical values TRUE and FALSE.
This is useful because a column with a header row can be averaged without special handling:
=AVERAGE(B:B)The header text in B1 is skipped, and so is any note typed below the data. The same rule hides a common problem: numbers stored as text. If a value was imported or typed with a leading apostrophe, it looks like a number but is text, so AVERAGE ignores it. Excel often flags such cells with a small green triangle. When your average seems too high or too low, compare the two counts:
=COUNT(B2:B6)
=COUNTA(B2:B6)If COUNTA is larger than COUNT and you expected all cells to be numbers, some entries are text. The same check helps after you paste data from another system.
Values typed directly as arguments
The skip rules above apply to values that come from references. Values typed straight into the formula are treated differently:
=AVERAGE(1, TRUE, "3")Here TRUE counts as 1 and the text "3" is converted to the number 3, so the result is (1 + 1 + 3) / 3, or 1.6667. Text that cannot be converted, such as =AVERAGE("abc"), returns #VALUE!.
Typing logical values or quoted numbers into AVERAGE is rare. The rule matters mainly when you move a reference into a formula as a literal and the result changes.
Several arguments and whole columns
Like SUM, AVERAGE accepts many arguments, which can be ranges, single cells, or constants:
=AVERAGE(B2:B6, D2:D6, 100)Excel pools every number from all arguments into one set. It then divides the total by the total count. It does not average each argument and then average those results. This distinction matters whenever the groups have different sizes.
For example, if B2:B6 has five numbers averaging 60 and D2:D6 has two numbers averaging 90, the pooled average is closer to 60 than to the midpoint of 75. Averaging two averages gives equal weight to groups that should not have equal weight.
Whole-column references such as B:B work and automatically include new rows added below. They are fine for a sheet that holds only one table. If other numbers sit in the same column, such as a total at the bottom, the average will include them. A total row inside the referenced range is a classic cause of a mean that is far too high.
Copying AVERAGE formulas
References in a formula shift when you copy it. If =AVERAGE(B2:B6) in B7 is copied to C7, it becomes =AVERAGE(C2:C6). This is usually what you want for column-by-column summaries.
When one range must stay fixed, anchor it with dollar signs:
=AVERAGE($B$2:$B$6)Now every copy of the formula points at B2:B6. A typical use is a grid of cells that each compare a value against the same overall mean. If the range is not anchored, copying down one row turns it into B3:B7, then B4:B8, and the result silently drifts.
Errors and empty data sets
AVERAGE fails in two ways.
No numbers to average. If the range holds only blanks and text, the count is zero and the division fails, so AVERAGE returns #DIV/0!. This often happens early in a project, before data is entered, or when a filter formula returns nothing. Test the count first:
=IF(COUNT(B2:B6)=0, "No data", AVERAGE(B2:B6))An error inside the range. If any cell in the range contains an error such as #N/A or #REF!, AVERAGE returns that same error. It does not skip it. The cause is in the source cell, so fix the source.
Many people wrap the formula in IFERROR to hide every problem. That works, but it also hides real mistakes, such as a broken reference, behind a friendly message. The COUNT check above is narrower: it handles only the empty case and still lets other errors show.
Display versus value
The number format changes how a mean is shown, not what it is. A cell showing 56.7 can hold 56.6666666667. Formulas that refer to it use the full value. If you need the stored value rounded, say so in the formula:
=ROUND(AVERAGE(B2:B6), 1)Do this only when the rounded figure is the one you want to carry forward. Rounding early and averaging again compounds small errors.
Limits of the mean
The mean is sensitive to extreme values. One entry of 10,000 among scores near 80 raises the mean far above any typical score. Pair AVERAGE with MIN and MAX to see the spread, or check the data for entry mistakes. AVERAGE also includes values in hidden or filtered rows. When you need a mean of only the visible rows, or of only the rows meeting a condition, use the functions covered at the end of this tutorial: SUBTOTAL, and AVERAGEIF, which averages only the cells meeting a criterion.
Summary of AVERAGE behavior
| Situation | Result |
|---|---|
| Range with numbers and blanks | Blanks ignored |
| Range with text or TRUE/FALSE | Ignored |
| Cell containing 0 | Counted as a number |
| Number stored as text | Ignored |
| Range with no numbers | `#DIV/0!` |
| Error value in range | That error is returned |
| Hidden or filtered rows | Still included |
Exercise
A range A2:A7 contains 10, 20, an empty cell, the text "n/a", 0, and 30. What does =AVERAGE(A2:A7) return, and what would it return if the 0 were an empty cell instead?
Show answer
The numeric cells are 10, 20, 0, and 30. Their sum is 60 and their count is 4, so the result is 15. If the 0 were empty, the numbers would be 10, 20, and 30, with sum 60 and count 3, so the result would be 20.
Exercise
B2:B10 sometimes has no numbers yet. Write a formula that shows the text "Waiting" in that case and the mean otherwise. Why is this better than wrapping AVERAGE in IFERROR?
Show answer
=IF(COUNT(B2:B10)=0, "Waiting", AVERAGE(B2:B10)). It handles only the empty-data case. IFERROR would also hide unrelated errors, such as #REF! or an #N/A inside the data, which should be fixed rather than masked.
Exercise
You expect eight scores in C2:C9, but =AVERAGE(C2:C9) looks too high. COUNT(C2:C9) returns 6 and COUNTA(C2:C9) returns 8. What is the likely cause and what do you do?
Show answer
Two of the cells hold text instead of numbers, such as numbers stored as text or notes like "absent". AVERAGE ignores them, so the mean covers only six scores. Find the two cells, convert any text numbers to real numbers, and decide whether text entries should be blanks or zeros.