COUNT

Count how many cells hold numbers, ignoring text and blanks.

Syntax

COUNT(value1, [value2], ...)
Argument Required Description
value1 Required A range or value to count.
value2 Optional Further ranges or values.

Examples

Every example below was executed against VisiGrid engine 0.35.0 — not transcribed from another vendor's documentation. Reproduce any of them with vgrid calc.

Formula Result Notes
=COUNT(A1:A5) 3 Five cells, but only three hold numbers.
=COUNTA(A1:A5) 4 For contrast — COUNTA counts the text too.

Three functions, three questions

The range A1:A5 above holds 10, apple, a blank, 20 and 30:

FunctionResultCounts
COUNT3numbers only
COUNTA4anything not blank
COUNTBLANK1blanks only

They sum to more than five because COUNT and COUNTA overlap. Picking the wrong one is a quiet way to divide by the wrong denominator.

COUNT is the right choice when the number is going into an average or a rate, because it matches what AVERAGE itself counts.

Excel compatibility

Matches Excel.

Related functions

Last updated