ShareYourGroupShareYourGroupExcel Formulas

Statistical functions

COUNT, COUNTA and COUNTBLANK functions in Excel

COUNT counts cells that hold numbers, COUNTA counts cells that are not empty, and COUNTBLANK counts empty cells.

Counting sounds too simple to need three functions. But "how many?" hides a question: how many what? Cells with numbers, cells with anything in them, or cells with nothing? Choosing the wrong counter is one of the commonest quiet errors in a spreadsheet.

Syntax

=COUNT(value1, [value2], ...)
=COUNTA(value1, [value2], ...)
=COUNTBLANK(range)
ArgumentWhat it is
value1, value2, ...Cells or ranges to count in.
rangeFor COUNTBLANK: one range.

Examples

Each result below is what Excel itself showed for the formula on the sample sheet.

Sample sheet: Marks of eight students in three subjects. One Science mark is missing (cell D6 is empty).
ABCDE
1NameClassMathsScienceEnglish
2Asha8A788591
3Ravi8B455260
4Meena8A928879
5Kabir8B334138
6Tara8A6772
7Joy8B889084
8Neha8A546158
9Imran8B787369

The three counters

FunctionCounts
COUNTcells that contain numbers (dates and times are numbers too)
COUNTAcells that contain anything: numbers, text, TRUE or FALSE, errors
COUNTBLANKcells that are empty

The A in COUNTA can be read as "all" or "anything".

Which one do I want?

Using COUNT on a column of names gives 0, as the fourth example shows. Using COUNTA on a column of amounts counts a stray note or heading as if it were a sale.

Cells that look empty and are not

COUNTA is stricter about "empty" than your eyes are. It counts:

COUNTBLANK, on the other hand, treats a formula returning "" as blank. So for the same range, COUNTA plus COUNTBLANK can come to more than the number of cells. If COUNTA gives a higher figure than you expect, look for cells holding a lone space. The TRIM function and Find and Replace can clear them.

Numbers stored as text

COUNT skips numbers that are stored as text, just as SUM does. If COUNT gives fewer than you can see, that is the reason. Comparing COUNT(range) with COUNTA(range) is a quick test: when they differ on a column that should be all numbers, something in it is not a real number.

Counting with a condition

These three count everything of a kind. To count only the cells that meet a condition, such as marks of 33 or more or rows for one class, use COUNTIF and COUNTIFS.

Uses

The size of a list that keeps growing. =COUNTA(A:A)-1 counts the entries in column A, less the heading.

The last value in a column. =INDEX(A:A,COUNTA(A:A)) returns the last filled cell, provided there are no gaps.

A progress figure. =COUNT(D2:D9)/COUNTA(A2:A9) is the share of students whose marks are in. Format it as a percentage.

Common mistakes

In Google Sheets

COUNT, COUNTA and COUNTBLANK work the same way in Google Sheets.

Related functions

Every result on this page was calculated in Microsoft Excel (version 16.0, build 20326) on 12 November 2026, not typed by hand.

This is an independent help site. It is not connected with or approved by Microsoft. Excel and Microsoft 365 are trademarks of Microsoft Corporation, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.