Skip to content

COUNTA

Counts the cells that are not empty, whether they hold numbers, text, errors or empty text returned by a formula.

Syntax

=COUNTA(, [value2], ...)

Statistical

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
A
B
1
Attendee
2
Ines Duarte
3
Tom Okafor
4
5
Priya Nair
6
Marco Bell
7
8
Lena Fischer
9
Sam Reyes
10
11
6

B11 =COUNTA(A2:A9) returns 6

How COUNTA works

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.

Typical uses

  • How many entries are there? Count names on a sign-up sheet, tasks in a tracker, or invoices in a register.
  • How many rows does a list have? =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.
  • How many cells were completed? Compare COUNTA with the number of rows to see how much of a form has been filled in.

What counts as non-empty

COUNTA includes:

  • numbers, dates and text;
  • TRUE and FALSE;
  • error values such as #N/A;
  • a cell holding a single space;
  • a formula that returns empty text (""). 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.

COUNTA, COUNT and COUNTBLANK

  • COUNT counts numbers only.
  • COUNTA counts everything that is not empty.
  • COUNTBLANK counts empty cells, and cells showing 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 "".

Counting with a condition

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.

Arguments

value1
The first cell, range or value to check, such as A2:A50.
value2, ...optional
More cells, ranges or values, up to 255 arguments in all.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

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
A
B
1
Attendee
2
Ines Duarte
3
Tom Okafor
4
5
Priya Nair
6
Marco Bell
7
8
Lena Fischer
9
Sam Reyes
10
11
6

B11 =COUNTA(A2:A9) returns 6

Example 2

A formula that returns "" still counts

B7 =COUNTA(C2:C5)

Result: 4

Only two invoices show "Paid", but all four cells contain a formula, so COUNTA returns 4.

B7
A
B
C
1
Invoice
Amount
Status
2
INV-901
100
Paid
3
INV-902
0
4
INV-903
50
Paid
5
INV-904
0
6
7
COUNTA of Status
4
8

B7 =COUNTA(C2:C5) returns 4

Example 3

Count only the cells that show text

B7 =COUNTIF(C2:C5,"?*")

Result: 2

"?*" matches text with at least one character, so the empty-text results are skipped.

B7
A
B
C
1
Invoice
Amount
Status
2
INV-901
100
Paid
3
INV-902
0
4
INV-903
50
Paid
5
INV-904
0
6
7
Paid invoices
2
8

B7 =COUNTIF(C2:C5,"?*") returns 2

Example 4

Errors are counted too

B7 =COUNTA(B2:B5)

Result: 4

A number, an error, text and TRUE are all non-empty, so all four are counted.

B7
A
B
C
1
Check
Result
2
Row 1
14
3
Row 2
#N/A
4
Row 3
ok
5
Row 4
TRUE
6
7
Filled cells
4
8

B7 =COUNTA(B2:B5) returns 4

Your turn.

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.

E2
A
B
C
D
E
1
Task
Owner
Measure
Result
2
Book venue
Ines
Tasks listed
3
Send invites
Tom
Tasks without an owner
4
Order catering
5
Print badges
Priya
6
Hire AV kit
7
Confirm speakers
Tom
8
Arrange parking
Ines
9
Post-event survey
10
11
12

Common mistakes

  • A formula that returns "" 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.
  • A cell holding a single space looks blank but is counted. Clean the data with TRIM, or find the offenders with =SUMPRODUCT(--(TRIM(A2:A50)=""),--(A2:A50<>"")).
  • COUNTA counts errors. A column full of #N/A results gives a high count, so check the data before using the count as a total of good rows.
  • Don't use COUNTA to count numbers. A text entry such as "n/a" is counted too. Use COUNT when you need numbers only.

Questions people ask

What is the difference between COUNT and COUNTA?

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.

Why does COUNTA count cells that look empty?

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.

How do I count non-blank cells that meet a condition?

Use COUNTIFS. For example, `=COUNTIFS(A2:A50,"<>",B2:B50,"East")` counts rows where column A is filled and column B is East.

How do I count the rows in a list that grows?

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)`.

Learn COUNTA in a real sheet.

COUNTA is taught in Excel foundations, lesson 7: COUNT and COUNTA. Each lesson is a short, graded exercise like the one above.