Function · Statistical
Excel COUNTBLANK function
The Excel COUNTBLANK function counts empty cells. Two cells in the six-cell hours log are empty, so it returns 2. A zero is not empty.
Syntax =COUNTBLANK(range)
=COUNTBLANK(B2:B7)Arguments
| Name | Required | What to pass |
|---|---|---|
| range | Required | One contiguous range. COUNTBLANK does not take a list of separate ranges the way COUNT does. |
Examples
Missing entries in the hours log
=COUNTBLANK(B2:B7)Result 2
| A | B | |
|---|---|---|
| 1 | # | Entry |
| 2 | 1 | Maya |
| 3 | 2 | 8 |
| 4 | 3 | |
| 5 | 4 | Jordan |
| 6 | 5 | |
| 7 | 6 | 6 |
| 8 | Blanks | 2 |
COUNTBLANK counts empty cells in one range. The hours log has six cells and two holes, so the result is 2. A zero is not a hole. Someone who worked zero hours and typed 0 is present in the log. Someone who has not typed anything is the cell this function is for.
A formula that returns "" looks empty and is counted. That is the awkward overlap with COUNTA, which also counts that formula. A cell with a space is not counted. The space is a character, so the cell is not blank, and COUNTA will include it.
The argument has to be one block of cells. COUNT and COUNTA will accept B2:B7 and D2:D7 as two arguments. COUNTBLANK will not.