COUNTA function
Counts all cells that are not empty, whatever they contain: numbers, text, dates, TRUE/FALSE, errors or even empty text returned by a formula.
Available in All versions of Excel, Excel for the web, Excel for Mac
In every Excel versionWorks in Google Sheets
Syntax
COUNTA(value1, [value2], ...)| Argument | What it means | |
|---|---|---|
value1 | Required | The first cell, range or value to count. |
value2, ... | Optional | Up to 254 more cells, ranges or values. |
Returns: A whole number: the count of non-empty cells.
How COUNTA works
COUNTA (the A stands for "all") counts every cell that has something in it. Use it to count names in a sign-up list, filled-in survey answers, tasks with a status, or the number of rows in a table. Unlike COUNT it does not care whether the content is a number or text.
The only cells it skips are truly empty ones. That includes some surprises: a cell with a single space, an apostrophe, or a formula that returns empty text (="") looks blank on screen but COUNTA counts it. If your total is higher than expected, look for formulas returning "" or stray spaces. To count the empty cells instead, use COUNTBLANK.
Examples
1How many people signed up?
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Attendee | Company | ||
| 2 | Maria Lopez | Brightline | 5 | |
| 3 | Tom Becker | |||
| 4 | Yuki Sato | Norvik | ||
| 5 | Sam Okafor | Brightline | ||
| 6 | ||||
| 7 | Lena Fischer | Atlas Ltd |
Result: 5
Five of the six cells in A2:A7 contain a name; the empty row is skipped. The result is 5 attendees.
2Count answers of any type
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Question | Answer | ||
| 2 | Age | 34 | 4 | |
| 3 | Member? | TRUE | ||
| 4 | City | Lyon | ||
| 5 | Visits | |||
| 6 | Joined | 2026-01-15 |
Result: 4
A number, a logical value, text and a date all count. Only the empty Visits answer is left out, so 4 questions were answered. =COUNT(B2:B6) would return only 2 (the age and the date).
3Count data rows below a header
| A | B | C | |
|---|---|---|---|
| 1 | Task | ||
| 2 | Draft budget | 4 | |
| 3 | Book venue | ||
| 4 | Send invites | ||
| 5 | Order catering |
Result: 4
Counting the whole column picks up the header plus four tasks, which is 5; subtracting 1 for the header gives 4. The count grows automatically as tasks are added below. Keep the formula out of column A, otherwise it would count itself and cause a circular reference.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
Count too high | Cells that look empty contain a space, an apostrophe or a formula returning "". | Check with =LEN(A6); clear the cells with Delete, or count real entries with =SUMPRODUCT(--(LEN(TRIM(A2:A7))>0)). |
Tips
- To count non-empty cells that meet a condition, use COUNTIF with the criterion
"<>"or COUNTIFS. - In an Excel Table,
=ROWS(Table1)is a cleaner way to count rows than COUNTA on a full column.
Questions
Does COUNTA count cells with formulas that return blank?
Yes. A formula returning "" makes the cell non-empty, so COUNTA counts it, while COUNTBLANK also counts it as blank. This is the one case where a cell is counted by both.
How do I count unique names instead of all names?
In Microsoft 365 use =COUNTA(UNIQUE(A2:A7)); if the range has blanks, wrap it with FILTER first: =COUNTA(UNIQUE(FILTER(A2:A7, A2:A7<>""))).
Google Sheets
COUNTA also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
COUNTA in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Czech | POČET2 |
| Danish | TÆLV |
| Dutch | AANTALARG |
| Finnish | LASKE.A |
| French | NBVAL |
| German | ANZAHL2 |
| Hungarian | DARAB2 |
| Italian | CONTA.VALORI |
| Norwegian (Bokmål) | ANTALLA |
| Polish | ILE.NIEPUSTYCH |
| Portuguese (Brazil) | CONT.VALORES |
| Portuguese (Portugal) | CONTAR.VAL |
| Russian | СЧЁТЗ |
| Spanish | CONTARA |
| Swedish | ANTALV |
| Turkish | BAĞ_DEĞ_DOLU_SAY |
Recipes that use COUNTA
- How to count cells that contain text in Excel
- How to count unique values in Excel
- How to create a dynamic named range in Excel
- How to find the last value in a column in Excel
- How to pick a random sample from a list in Excel