In the example shown, the formula in cell E6 is: 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: 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: 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:

Functions for counting

To count numbers only, use the COUNT function. To count numbers and text, use the COUNTA function. To count with one condition, use the COUNTIF function To count with multiple conditions, use the COUNTIFS function. To count empty cells, use the COUNTBLANK function.


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

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.