Sub topic 1
Cells and ranges: what the functions read
Prerequisites
You should know how to enter values, select ranges, and write formulas beginning with =. This chapter assumes basic worksheet navigation.
A cell is one location identified by a column letter and row number, such as B2. A range is a group of cells, such as B2:B6. Excel summary functions read the values in cells or ranges and return one result.
For example, a worksheet might contain:
| Cell | Value |
|---|---|
| B2 | 12 |
| B3 | 18 |
| B4 | blank |
| B5 | 25 |
| B6 | `late` |
The range B2:B6 includes all five cells. Blank cells and text can affect different functions in different ways.
Anatomy of a function call
An Excel function call has a function name followed by parentheses. The content inside the parentheses is the function's argument, meaning the input supplied to the function.
=SUM(B2:B6)
=AVERAGE(B2:B6)The colon means “through,” so B2:B6 means every cell from B2 through B6. A function can also accept separate arguments, divided by commas:
=SUM(B2:B6, D2:D6, 100)Adding values with SUM
SUM adds numeric values. In B2:B6, the formula =SUM(B2:B6) returns 55. It ignores the blank cell and the text late. If any cell contains an error, such as #N/A, SUM returns that error instead of a total.
=SUM(B2:B6)Use SUM for totals, not for counting entries. To add nonadjacent ranges, provide each range as an argument.
Finding the mean with AVERAGE
AVERAGE returns the arithmetic mean: the sum of numeric values divided by the number of numeric values. For the example range, it returns 18.33 because it uses 12, 18, and 25 only.
=AVERAGE(B2:B6)
=SUM(B2:B6)/COUNT(B2:B6)Both formulas produce the same result when the range contains numeric values. AVERAGE ignores blanks and text, but it includes numeric zero. If the range contains no numbers, it returns #DIV/0!.
> callout note > A blank cell is different from a cell containing zero. AVERAGE skips a blank but includes zero in its calculation.
Exercise
What does =AVERAGE(B2:B6) return if B2:B6 contains 10, 20, a blank, and the text "n/a"?
Show answer
It returns 15, because Excel averages only the two numeric cells.