Statistical function

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], ...)
ArgumentWhat it means
value1RequiredThe first cell, range or value to count.
value2, ...OptionalUp 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?

D2fx=COUNTA(A2:A7)
ABCD
1AttendeeCompany
2Maria LopezBrightline5
3Tom Becker
4Yuki SatoNorvik
5Sam OkaforBrightline
6
7Lena FischerAtlas 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

D2fx=COUNTA(B2:B6)
ABCD
1QuestionAnswer
2Age344
3Member?TRUE
4CityLyon
5Visits
6Joined2026-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

C2fx=COUNTA(A:A)-1
ABC
1Task
2Draft budget4
3Book venue
4Send invites
5Order 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.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 16 KB

Common errors and how to fix them

ErrorWhy it happensFix
Count too highCells 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.

LanguageFunction name
CzechPOČET2
DanishTÆLV
DutchAANTALARG
FinnishLASKE.A
FrenchNBVAL
GermanANZAHL2
HungarianDARAB2
ItalianCONTA.VALORI
Norwegian (Bokmål)ANTALLA
PolishILE.NIEPUSTYCH
Portuguese (Brazil)CONT.VALORES
Portuguese (Portugal)CONTAR.VAL
RussianСЧЁТЗ
SpanishCONTARA
SwedishANTALV
TurkishBAĞ_DEĞ_DOLU_SAY

Recipes that use COUNTA