Learn Excel
EN
Sets how numbers, dates and formulas look, so everything works just like your own Excel.

Home › Excel functions › COUNT & COUNTA

COUNT Function in Excel: COUNT, COUNTA and COUNTBLANK

Excel has three basic counting functions. COUNT counts numbers, COUNTA counts every non-empty cell, and COUNTBLANK counts empty cells. Picking the wrong one is a common source of wrong totals.

In this guide
  1. Syntax
  2. Example
  3. Try it yourself
  4. Which one to use
  5. Pitfalls
  6. In practice: who has checked in?
  7. Keep learning
  8. FAQ

Syntax

FunctionSyntaxCounts
COUNT=COUNT(value1, [value2], …)Cells with numbers (dates and times count too)
COUNTA=COUNTA(value1, [value2], …)Cells that aren't empty: numbers, text, errors, TRUE/FALSE
COUNTBLANK=COUNTBLANK(range)Empty cells

Example: the same range, three results

A
1Hours
28
3sick
47.5
5
66
7n/a
FormulaResultWhy
=COUNT(A2:A7)3Only 8, 7.5 and 6 are numbers
=COUNTA(A2:A7)5Everything except the empty A5
=COUNTBLANK(A2:A7)1Only A5 is empty

COUNT & COUNTA practice: try it yourself

Reading is one thing, typing it is another. Build the formula below step by step: the tips tell you what to type next, and you can click or drag across cells to add them, just like in Excel.

Task: Count how many cells in B2:B7 contain a number, in D2: =COUNT(B2:B7)

Which one should you use?

  • How many numeric entries? COUNT. For example, how many days have hours logged.
  • How many rows are filled in? COUNTA on a column that's always filled, such as a name or ID column.
  • How many are still missing? COUNTBLANK.
  • How many meet a condition? COUNTIF or COUNTIFS.

Pitfalls

  • Numbers stored as text are not counted by COUNT, only by COUNTA.
  • Formulas that return "" (empty text, for example from =IF(B2>0, B2, "")) look empty, but COUNTA counts them. COUNTBLANK also counts them as blank, so COUNTA + COUNTBLANK can exceed the number of cells.
  • A space typed in a cell makes it non-empty for COUNTA.
  • Filtered lists: to count only visible rows, use =SUBTOTAL(103, A2:A100). See SUBTOTAL.

In practice: who has checked in?

At a training day, column A lists everyone who registered and column B gets the check-in time. Three formulas give the overview at the door:

AB
1NameCheck-in
2Anna8:52
3Ben
4Chris9:01
5Dana9:03
6Eli
7Femke9:10
  • Registered: =COUNTA(A2:A7) → 6
  • Checked in: =COUNT(B2:B7) → 4
  • Not yet: =COUNTBLANK(B2:B7) → 2

COUNTA counts the names (text), COUNT only the times (numbers) and COUNTBLANK the empty cells. Together they always add up: 4 + 2 = 6.

Frequently asked questions

What's the difference between COUNT and COUNTA?

COUNT only counts cells with numbers. COUNTA counts every cell that isn't empty, including text.

Why does COUNTA count cells that look empty?

They contain something invisible: a space, or a formula that returns empty text (""). Check a cell with =LEN(A2).

How do I count cells with text only?

Use =COUNTIF(A2:A100, "*"). The asterisk matches any text, but not numbers.

How do I count unique values?

In Microsoft 365 or Excel 2021+, use =COUNTA(UNIQUE(A2:A100)).