COUNTBLANK()

Syntax. COUNTBLANK(area)

Definition. This function counts the empty cells in a cell range.

Arguments

  • area (required). The reference to the cells that you are testing for empty cells

Background. This function counts not only the empty cells but also the cells containing empty strings. Cells containing the value 0 are not counted. This function is related to the COUNTIF() function. However, the COUNTIF() function evaluates numbers and text differently.

Note

The COUNTBLANK() function is also included in Chapter 12.

Example. Perform a few tests to get familiar with this function. Assume cells B2 through B8 contain a, b, =””, nothing, 0, 1, and 2:

  • COUNTBLANK(B2:B8) returns 2 because the function counts B4 and B5 as empty cells.

  • COUNTIF(B2:B8,">0") ...

Get Microsoft® Excel® 2010 Formulas & Functions Inside Out now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.