Investment Studio > Expressions > Functions > Statistical > COUNTIF

integer countif(array data, string criteria)

Returns the number of elements in the data array which satisfy the condition specified in the criteria string.

criteria can be a value or a quoted expression: 2, "2", ">2", "apples" are all valid criteria. The absence of an explicit (quoted) operator implies equality.

Examples

=countif({4, 3, 2, 1}, ">2")

and

=countif({"apples", "oranges", "pears", "apples"}, "apples")

both equal 2;

=countif({1, 2, 3, 4}, "<3.5")

equals 3.

See also count, counta, countblank, frequency, sumif.