Formualizer Docs

COUNT

Counts numeric values across scalars and ranges.

COUNT evaluates all arguments and counts how many are numeric values. Numbers, dates, and text representations of numbers (when supplied directly) are counted.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=COUNT(value1, [value2], ...)

Arguments

ArgumentTypeRequiredDefault
value1number (range)Required—
value2number (range)Optional—

Accepts a variable number of arguments. Minimum: 1.

Differences from Excel

Formualizer accepts a call with no arguments and returns zero. Excel requires the first argument.

Remarks

  • Text values inside ranges are ignored and not counted.
  • Blank cells and logical values in ranges are ignored.

Examples

Count numeric values in a range that also includes text.

Formula =COUNT(A1:A3)

Input cells
A
13
2"five"
37

Expected result 2

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Add a literal numeric argument to the range count.

Formula =COUNT(A1:A3,12)

Input cells
A
13
2"five"
37

Expected result 3

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

A nonnumeric text argument contributes zero to the count.

Formula =COUNT("x")

Expected result 0

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Counting mixed scalar inputs

Formula =COUNT(1, "x", 2, 3)

Expected result 3

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Counting in a range

Formula =COUNT(A1:A3)

Input cells
A
110
2"foo"
320

Expected result 2

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

Why doesn't COUNT include text in a range?

COUNT only counts numeric values; text cells in ranges are ignored.

Can direct text like "12" be counted?

Yes. Direct scalar arguments are coerced and counted when they parse as numbers.

Implementation

Engine source

On this page