COUNTBLANK Function

Excel Functions › Statistical

All versions Statistical

The Excel COUNTBLANK function counts the empty cells in a range — including cells holding a formula that returns an empty string. It's the quick way to find gaps in your data.


Quick answer:
=COUNTBLANK(A2:A20) number of empty cells in A2:A20

Syntax

=COUNTBLANK(range)
ArgumentDescription
rangeRequiredThe single range in which to count empty cells.

How to use it

COUNTBLANK reports how many cells in a range are empty. A formula that returns "" is treated as blank here (the opposite of COUNTA), which makes COUNTBLANK useful for spotting missing entries.

=COUNTBLANK(A2:A20) // empty cells in the range

If A2:A20 has 19 cells and 5 are empty, the formula returns 5. A cell containing a zero or a space is not blank — only genuinely empty cells (and ""-returning formulas) count.

Counterpart to COUNTA: in any range, COUNTA(range) + COUNTBLANK(range) roughly equals the total cell count — though formulas returning "" are counted by both, so the two can overlap.

Try it: interactive demo

Live demo

Pick a COUNTBLANK example to see the formula and its result.

Result:

Practice workbook

📊
Download the free COUNTBLANK practice workbook
Every example on this page, ready to open in Excel — plus practice challenges with answers on a separate tab. No sign-up required.

Frequently asked questions

Does COUNTBLANK count cells with a space or zero?
No. A cell containing a space character or the number 0 holds a value, so it is not counted as blank. Only genuinely empty cells (and formulas returning "") are counted.
Does COUNTBLANK count a formula that returns ""?
Yes — a formula returning an empty string is treated as blank by COUNTBLANK, even though the cell technically contains a formula.
Can COUNTBLANK take multiple ranges?
No. COUNTBLANK accepts a single range argument. To count blanks across several areas, add multiple COUNTBLANK calls together.
How is COUNTBLANK different from COUNTA?
They are opposites: COUNTA counts non-empty cells, while COUNTBLANK counts empty ones. (Formulas returning "" are the tricky case — COUNTA counts them, and so does COUNTBLANK.)

Master functions like this in one day

This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related functions: COUNTA · COUNT · COUNTIF · COUNTIFS · ISBLANK · SUM