3.5.2.6 Countif

Description

This function is used to count the number of values that satisfies a specified condition.

Syntax

 double Countif(vector vd, string con$)

Parameters

vd

is a vector in which you want to count the number.

con$

is the condition you use to find a sub-range. Double quotation ("") must be added for the condition. Support simpler condition: countif(col(A), "col(A)>10") can be written as countif(col(A), ">10").

Return

Return the count of values that satisfied the condition con$.

Example

newbook;
col(A) = data(1,32);
countif(col(A),"col(A) > 5 && col(A) < 10")=;//should return 4
//simpler condition
countif(col(A), "boston")=;
countif(A, 2)=;
countif(A, "!=2")=;


See Also

Sumif, Averageif