Example 1
Count the entries on a list
B11 =COUNTA(A2:A9)
Result: 6
Six of the eight rows have a name. Rows 4 and 7 are empty and are not counted.
B11 =COUNTA(A2:A9) returns 6
Counts the cells that are not empty, whether they hold numbers, text, errors or empty text returned by a formula.
Syntax
=COUNTA(, [value2], ...)
All versions of Excel, including Excel for Microsoft 365 and Excel for the web.
Try it
Edit the formula in B11 or change the inputs. The sheet recalculates as you type.
B11 =COUNTA(A2:A9) returns 6
COUNTA counts the cells that have something in them. The "A" stands for "all": numbers, text, dates, TRUE and FALSE, and error values all count. Only truly empty cells are left out.
=COUNTA(A2:A500) returns the number of filled rows, which you can use to size a range or check a count against a system total.COUNTA includes:
TRUE and FALSE;#N/A;""). The cell looks blank, but it contains a formula, so COUNTA counts it.That last point catches many people out. If column C has =IF(B2>0,"Paid","") filled down, COUNTA counts every row, not just the paid ones. To count only cells that show something, use =COUNTIF(C2:C9,"?*"), which matches text with at least one character, or =SUMPRODUCT(--(C2:C9<>"")), which counts every cell that is not empty or empty text.
The three can overlap. A cell holding a formula that returns "" is counted by COUNTA (it has a formula in it) and also by COUNTBLANK (it shows nothing), so you can't assume COUNTA plus COUNTBLANK equals the number of cells when a sheet uses "".
For a count that depends on what the cells hold, use COUNTIF or COUNTIFS. For example, =COUNTIF(A2:A50,"<>") also counts non-blank cells, and it can be extended with extra conditions in COUNTIFS.
A2:A50.Each example is a live sheet. Change the inputs or the formula and watch the result.
Example 1
B11 =COUNTA(A2:A9)
Result: 6
Six of the eight rows have a name. Rows 4 and 7 are empty and are not counted.
B11 =COUNTA(A2:A9) returns 6
Example 2
B7 =COUNTA(C2:C5)
Result: 4
Only two invoices show "Paid", but all four cells contain a formula, so COUNTA returns 4.
B7 =COUNTA(C2:C5) returns 4
Example 3
B7 =COUNTIF(C2:C5,"?*")
Result: 2
"?*" matches text with at least one character, so the empty-text results are skipped.
B7 =COUNTIF(C2:C5,"?*") returns 2
Example 4
B7 =COUNTA(B2:B5)
Result: 4
A number, an error, text and TRUE are all non-empty, so all four are counted.
B7 =COUNTA(B2:B5) returns 4
Solve it in the sheet. Every answer is checked, with hints if you need them.
Task 1 of 2
In E2, count the tasks listed in column A. Allow for rows 10 and 11 to be filled in later.
Answer in E2.
"" is counted as non-empty. If your list is built with IF formulas, COUNTA counts every row. Use COUNTIF(range,"?*") to count only the cells that show text.=SUMPRODUCT(--(TRIM(A2:A50)=""),--(A2:A50<>"")).#N/A results gives a high count, so check the data before using the count as a total of good rows.COUNT only counts cells that hold numbers (including dates). COUNTA counts every cell that is not empty: numbers, text, errors, TRUE and FALSE, and empty text from formulas.
Those cells probably contain a formula that returns `""`, or a space. They aren't truly empty. Use `=COUNTIF(A2:A50,"?*")` to count only the cells that show text.
Use COUNTIFS. For example, `=COUNTIFS(A2:A50,"<>",B2:B50,"East")` counts rows where column A is filled and column B is East.
Use `=COUNTA(A:A)-1` for a column with a header and no gaps, or `=COUNTA(A2:A1000)` to cover a fixed length. An Excel table also gives you a count with `=ROWS(Table1)`.
COUNTA is taught in Excel foundations, lesson 7: COUNT and COUNTA. Each lesson is a short, graded exercise like the one above.