Jump to content

Documentation/Calc Functions/COUNTBLANK

From The Document Foundation Wiki

Function name:

COUNTBLANK

Category:

Statistical Analysis

Summary:

Counts the empty cells in a specified cell range.

Syntax:

COUNTBLANK(Range)

Returns:

Returns a non-negative integer that is the count of empty cells in the specified range.

Arguments:

Range specifies the cell range containing the empty cells to be counted. It may be a simple reference to a cell range, the name of a named or database range, or an inline array.

  • A cell that contains blank text, such as a string containing only spaces, is not considered empty by COUNTBLANK even though it may appear empty.
  • A cell that contains an empty string, such as returned by the formula ="", is considered empty by COUNTBLANK. Note, however, that the ISBLANK function would consider such a cell to be not blank (returning FALSE).

Additional details:

  • Calc provides the following related counting functions:
    • Use COUNT to count how many numbers (ignoring text strings and error values) are contained in a list of arguments.
    • Use COUNTA to count how many values (including text strings and error values) are contained in a list of arguments.
    • Use COUNTIF to count the number of cells in a cell range that meet a specified criterion.
    • Use COUNTIFS to count the number of cells that meet specified criteria in multiple ranges.

Examples:

Formula Description Returns
=COUNTBLANK(A1:B2) where cells A1, A2, B1, and B2 are all empty. Here the function counts all the empty cells. 4
=COUNTBLANK(A1:A5) where cell A1 contains the number 120; cell A2 contains the formula ="" (empty string); cell A3 contains the number 0; cell A4 contains the formula =3/0 (error #DIV/0!); and cell A5 is empty. Here the function counts cells A2 and A5 as empty. 2
=COUNTBLANK({1; 2; 3; 4; ; ; ; }) Here the function counts four empty entries. 4

Related LibreOffice functions:

COUNT

COUNTA

COUNTIF

COUNTIFS

ISBLANK

ODF standard:

Section 6.13.8, part 2

Related (or similar) Excel functions:

COUNTBLANK