Sub topic 5
Counting numbers with COUNT
This chapter assumes you can enter data and formulas in Google Sheets and understand cell addresses such as B2. You should also know that a range, such as B2:B6, means all cells from B2 through B6.
What COUNT does
COUNT returns the number of cells in a range that contain numeric values. It does not add the values. It counts them.
=COUNT(B2:B6)If B2 through B6 contain 12, 18, `, pending, and 25, the result is 3`. The blank cell and the text are not counted.
A zero is a number, so COUNT includes it. A number stored as text is different. For example, a cell containing the text "25" may look like a number, but COUNT normally ignores it.
| Cell | Content | Counted by COUNT? |
|---|---|---|
| B2 | 12 | Yes |
| B3 | 0 | Yes |
| B4 | blank | No |
| B5 | pending | No |
| B6 | `"25"` stored as text | No |
Test a range step by step
Suppose column B contains daily quantities:
=COUNT(B2:B6)Sheets examines each cell in the range and counts numeric values. The result is useful when you need to know how many measurements, prices, scores, or other numeric entries are available.
To check the actual data, select a cell and look at the formula bar. A value aligned or formatted like a number is not always stored as a number. Imported data can contain numbers stored as text, often because of a leading apostrophe, extra spaces, or inconsistent formatting.
A formula such as this can reveal whether the range contains fewer numeric entries than expected:
=COUNT(B2:B6)If you expect five measurements but the result is three, inspect the other cells. They may be blank, text labels, or numbers stored as text.
Compare COUNT with other counting functions
Choose the counting function based on what you want to measure:
| Function | Counts | Example use |
|---|---|---|
| `COUNT` | Numeric cells | Number of recorded scores |
| `COUNTA` | Non-empty cells, including text | Number of completed entries |
| `COUNTBLANK` | Empty cells | Number of missing entries |
For example, if A2:A6 contains names and B2:B6 contains scores:
=COUNT(B2:B6)
=COUNTA(A2:A6)
=COUNTBLANK(B2:B6)The first formula counts scores that are numeric. The second counts cells containing names or any other value. The third identifies missing score cells.
COUNT also accepts more than one range:
=COUNT(B2:B6, D2:D6)This counts numeric cells in both ranges. You can include an individual numeric value as another argument, although a cell reference is usually easier to audit:
=COUNT(B2:B6, D2:D6, 100)Understand related formulas
COUNT is often the divisor in an average calculation. AVERAGE(B2:B6) effectively adds the numeric values and divides by their count. If there are no numeric values, AVERAGE returns #DIV/0!, because it has nothing to divide by. You can test first with COUNT or handle the result with IFERROR.
For category-specific counting, use COUNTIF:
=COUNTIF(B2:B6, ">100")This counts only cells in B2:B6 whose numeric value is greater than 100.
Exercise
B2:B6 contains 14, 0, blank, "21" stored as text, and 8. What do COUNT(B2:B6), COUNTA(B2:B6), and COUNTBLANK(B2:B6) return?
Show answer
COUNT returns 3 because 14, 0, and 8 are numbers. COUNTA returns 4 because four cells are non-empty. COUNTBLANK returns 1.