Summary

The Excel COUNTBLANK function returns a count of empty cells in a range. Cells that contain text, numbers, errors, spaces, etc. are not counted. Formulas that return empty strings ("") are counted as blank.

Purpose 

Count cells that are blank

Return value 

A number representing blank cells

Syntax

=COUNTBLANK(range)
  • range - The range in which to count blank cells.

How to use 

The COUNTBLANK function returns a count of empty cells in a range. Cells that contain text, numbers, errors, spaces, etc. are not counted. Formulas that return an empty string ("") are counted as blank. COUNTBLANK takes just one argument, range, which must be a cell range.

Examples

In the example shown, the formula in cell E6 is:

=COUNTBLANK(B5:B15) // returns 3

COUNTBLANK returns 3 since there are 3 blank cells in the range. Note that cell B12 is not included because it contains a space character (" "). Cell B13 contains a formula that returns an empty string:

="" // formula in B13

COUNTBLANK considers B13 blank and includes it in the count.

Formulas that return empty strings

The IF function is often used to return empty strings. For example, if A1 contains 21, this formula in B1 will return an empty string:

=IF(A1>30,"Overdue","")

The idea is that that cell B1 should be empty unless the value in A1 is greater than 30. The COUNTBLANK function will indeed count B1 as empty when the value in A1 is less than or equal to 30. However it's worth noting that COUNTA and COUNTIFS will count B1 as not empty in the same case. In other words they will see the empty string ("") returned by IF as not blank.

Invisible characters

Some cells look empty, but actually contain invisible characters. To check which cells are blank use Go To > Special > Blanks:

  1. Select a range
  2. Open Go To dialog (Control + G)
  3. Press "Special"
  4. Select "Blanks"

Functions for counting

Notes

  • Cells that contain text, numbers, errors, etc. are not counted.
  • Cells with formulas that return an empty string ("") are counted.
  • Cells that contain only a single quote (') are counted.
  • Cells that contain zero are not counted.
Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.