Math and statistics
COUNTA function playground
Counts cells that are not empty: numbers, text, dates, logical values and errors.
The playground runs in your browser. Nothing you type is sent anywhere.
How COUNTA works
COUNTA counts every cell that has anything in it. "pending", "n/a", numbers and dates all count; only truly empty cells are skipped.
A formula that returns an empty string ("") still counts as not empty, because the cell holds a formula.
Syntax
=COUNTA(value1, [value2], ...)| Argument | What it means |
|---|---|
value1required | The first cell, range or value to check. |
value2, ...optional | More cells, ranges or values. |
Examples
| Formula | What it does | Result |
|---|---|---|
=COUNTA(B2:B9) | Orders that have a customer name. | 7 |
=COUNTA(D2:D9) | Amount cells with anything in them, including "pending". | 7 |
=COUNTA(A2:A9)-COUNTA(B2:B9) | Orders with no customer name. | 1 |
=COUNTA(A1:D1) | How many column headings there are. | 4 |
Common mistakes
Cells that look emptyA cell with a space in it looks blank but COUNTA counts it. Use TRIM or clear the cell.
COUNT vs COUNTACOUNT counts numbers only; COUNTA counts everything that isn't empty.
Related functions
Learn more
Download the example workbook (.xlsx)
The workbook has the same sample data and formulas, plus a practice sheet.