SpreadJS Documentation
COUNTBLANK
SpreadJS Documentation > Formula Reference > Formula Functions > COUNTBLANK

This function returns the number of empty (or blank) cells in a range of cells on a sheet.

Syntax

COUNTBLANK(cellrange)

Arguments

This function takes a cell range reference as an argument.

Remarks

This function counts the number of empty or blank cells in the specified cell range on one sheet. This function does not count cells containing an empty string "". A cell is empty if the cell's Value is null (Nothing in VB). Note that there is a difference being a cell's Value being null and a cell's Value being the empty string "". For example, consider the following Spread code in C#:

     SpreadJS[0].Cells[0,0].Value = null; // empty

     SpreadJS[0].Cells[1,0].Value = ""; // string

     SpreadJS[0].Cells[2,0].Value = "abc"; // string

     SpreadJS[0].Cells[3,0].Value = 123.0; // number

     SpreadJS[0].Cells[4,0].Formula = "COUNTBLANK(A1:A4)";

The formula in cell A5 evaluates to 1 because cell A1 is the only cell in the range A1:A4 that is empty.

Note: Function implementation generally tries to follow the behavior found in popular spreadsheet applications; however, not all these applications agree whether the empty string "" should be treated the same as an empty cell. In GC.Spread, both the COUNTBLANK and ISBLANK functions consistently treat the empty string "" differently than an empty cell.

Data Types

Accepts cell range reference. Returns numeric data.

Examples

COUNTBLANK(A1:G5)

COUNTBLANK(R6C3:R9C4)

See Also