Maths functions
COUNT and COUNTA functions in Google Sheets and Excel
COUNT counts the cells that hold numbers, and COUNTA counts every cell that isn't empty.
COUNTA counts every cell that isn't empty: text, numbers, dates, TRUE or FALSE, errors and formulas that return empty text.
Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet
- Excel 2016
- Excel 2019
- Excel 2021
- Excel 2024
- Microsoft 365
- Google Sheets
Syntax
COUNT(value1, [value2], ...)COUNTA(value1, [value2], ...)Arguments in [brackets] are optional. In Google Sheets: COUNT(value1, [value2, ...]) and COUNTA(value1, [value2, ...]).
Example
=COUNT(F2:F13) reads: Count how many cells from F2 to F13 (the quantities) hold a number.
| A | B | C | D | E | F | G | H | I | J | K | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Order | Date | Customer | Product | Category | Qty | Price | Status | Qty entries | 12 | |
| 2 | 1001 | 2 Mar 2026 | Mara Okafor | Monstera | Plants | 1 | $34.00 | Shipped | |||
| 3 | 1002 | 2 Mar 2026 | Jonas Lind | Terracotta pot | Pots | 3 | $12.50 | Shipped | |||
| 4 | 1003 | 3 Mar 2026 | Priya Raman | Snake plant | Plants | 2 | $22.00 | Shipped | |||
| 5 | 1004 | 4 Mar 2026 | Tomás Ruiz | Watering can | Tools | 1 | $18.00 | Pending | |||
| 6 | 1005 | 5 Mar 2026 | Elif Demir | Fern | Plants | 4 | $9.50 | Shipped | |||
| 7 | 1006 | 5 Mar 2026 | Mara Okafor | Potting mix | Soil | 2 | $7.25 | Returned | |||
| 8 | 1007 | 6 Mar 2026 | Kenji Mori | Pruning shears | Tools | 1 | $24.00 | Shipped | |||
| 9 | 1008 | 7 Mar 2026 | Ines Varga | Ceramic pot | Pots | 2 | $19.00 | Pending | |||
| 10 | 1009 | 8 Mar 2026 | Jonas Lind | Monstera | Plants | 1 | $34.00 | Shipped | |||
| 11 | 1010 | 9 Mar 2026 | Sofia Rossi | Fern | Plants | 6 | $9.50 | Shipped | |||
| 12 | 1011 | 10 Mar 2026 | Priya Raman | Potting mix | Soil | 5 | $7.25 | Shipped | |||
| 13 | 1012 | 11 Mar 2026 | Leo Brandt | Snake plant | Plants | 1 | $22.00 | Pending |
K1 shows 12: there are twelve quantities in F2:F13.
How the spreadsheet calculates it
Counts how many cells in F2:F13 hold a number (text and empty cells don't count).
- 1. COUNT: Counts how many cells in
F2:F13hold a number (text and empty cells don't count).range=`F2:F13`: the cells to count. Only numbers (and dates) count
COUNTA example
=COUNTA(D2:D13) reads: Count how many cells from D2 to D13 (the product names) aren't empty.
| A | B | C | D | E | F | G | H | I | J | K | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Order | Date | Customer | Product | Category | Qty | Price | Status | Products | 12 | |
| 2 | 1001 | 2 Mar 2026 | Mara Okafor | Monstera | Plants | 1 | $34.00 | Shipped | |||
| 3 | 1002 | 2 Mar 2026 | Jonas Lind | Terracotta pot | Pots | 3 | $12.50 | Shipped | |||
| 4 | 1003 | 3 Mar 2026 | Priya Raman | Snake plant | Plants | 2 | $22.00 | Shipped | |||
| 5 | 1004 | 4 Mar 2026 | Tomás Ruiz | Watering can | Tools | 1 | $18.00 | Pending | |||
| 6 | 1005 | 5 Mar 2026 | Elif Demir | Fern | Plants | 4 | $9.50 | Shipped | |||
| 7 | 1006 | 5 Mar 2026 | Mara Okafor | Potting mix | Soil | 2 | $7.25 | Returned | |||
| 8 | 1007 | 6 Mar 2026 | Kenji Mori | Pruning shears | Tools | 1 | $24.00 | Shipped | |||
| 9 | 1008 | 7 Mar 2026 | Ines Varga | Ceramic pot | Pots | 2 | $19.00 | Pending | |||
| 10 | 1009 | 8 Mar 2026 | Jonas Lind | Monstera | Plants | 1 | $34.00 | Shipped | |||
| 11 | 1010 | 9 Mar 2026 | Sofia Rossi | Fern | Plants | 6 | $9.50 | Shipped | |||
| 12 | 1011 | 10 Mar 2026 | Priya Raman | Potting mix | Soil | 5 | $7.25 | Shipped | |||
| 13 | 1012 | 11 Mar 2026 | Leo Brandt | Snake plant | Plants | 1 | $22.00 | Pending |
K1 shows 12: every order has a product name.
More COUNT and COUNTA examples
=COUNT(B2:B13)How many orders have a real date (dates are numbers).=COUNT(C2:E9)How many monthly figures have been entered for the whole team.=COUNTA(A2:A100)-COUNT(A2:A100)How many entries in A2:A100 are text rather than numbers.=IF(COUNT(C2:E2)=3,"Complete","Missing months")Checks that a rep has all three months filled in.=COUNTA(A2:A100)How many rows have been filled in, in a list that grows.=COUNTA(E2:E7)How many campaigns have an owner.=ROWS(E2:E7)-COUNTA(E2:E7)How many campaigns still have no owner.=INDEX(A:A,COUNTA(A:A))The last entry in column A, when the list has no gaps.
Paste any of these into the formula explainer to see it step by step.
Tips
- Use COUNT for columns of numbers or dates, COUNTA for columns of text.
- Leave headers out of the range so they aren't counted.
- Compare COUNT with COUNTA on the same column to spot numbers stored as text.
- For a condition ("how many Pending"), switch to COUNTIF or COUNTIFS.
What COUNT and COUNTA are used for
How many orders, entries or responses there are; how many rows have a value filled in; checking that a month has all its figures; and as the "how many" half of a do-it-yourself average or percentage complete.
Arguments
COUNT
| Argument | Required | What it is |
|---|---|---|
| value1 | Yes | The first cell, range or value to count, such as F2:F13. Numbers and dates count; text, errors and empty cells don't. |
| value2, ... | No | Up to 255 cells, ranges or values in all, counted together. |
COUNTA
| Argument | Required | What it is |
|---|---|---|
| value1 | Yes | The first cell, range or value to count, such as D2:D13. Only truly empty cells are skipped. |
| value2, ... | No | Up to 255 cells, ranges or values in all, counted together. |
Common mistakes
Using COUNT on names: text isn't a number, so the answer is 0.
Counting a column of numbers stored as text, which often happens with exports: COUNT skips them and says 0 or too few.
COUNTAwould count them.Using COUNT to count orders for one product or rows that say "Yes": that needs
COUNTIF, which counts the cells that match a condition.Counting a range that includes the header: COUNTA counts the header too.
Cells that look empty but hold a formula returning "" are counted, so the count comes out too high. Microsoft documents that COUNTA counts empty text.
Using COUNTA on a column of numbers where some cells hold notes like "tbc": the notes are counted too. Use COUNT for numbers only.
In Google Sheets
Google Sheets has COUNT and COUNTA with the same arguments (value1, value2…). Google's help describes COUNT as counting numeric values and COUNTA as counting all values, as in Excel.
Errors you may see with COUNT and COUNTA
- #REF!: The counted range was deleted (a column removed), so the formula shows #REF! instead of a count.
- Circular reference: A whole-column count, such as `=COUNTA(A:A)`, placed inside that same column counts itself.
Questions
What's the difference between COUNT and COUNTA?
COUNT counts numbers (dates are numbers too); COUNTA counts anything that isn't empty. On a column of names COUNT gives 0 and COUNTA gives the number of names. To count cells that match something, use COUNTIF. See SUM, AVERAGE and COUNT.
Why does COUNT return 0?
The range holds text: names, or numbers stored as text. Check one cell with ISNUMBER; FALSE means it's text, and COUNT will skip it.
How do I count empty cells?
Use COUNTBLANK(E2:E7). Subtracting, ROWS(E2:E7)-COUNTA(E2:E7), gives the same answer unless some cells hold a formula that returns "": COUNTBLANK counts those as blank, COUNTA counts them as filled.
Does COUNTA count cells with a space?
Yes. A cell holding only a space isn't empty, so COUNTA counts it. Find them with LEN(A2), which shows 1 for a single space.
Sources
Official documentation the facts on this page were checked against.