COUNTIF function

COUNTIF returns the number of cells that meet criteria within a cell range.

Syntax

COUNTIF(range, criteria)

Example

A1:A10 is a cell range containing the numbers 2000 - 2009. Cell B1 contains the number 2006. In cell B2, you enter a formula:

=COUNTIF(A1:A10,2006) returns 1.

=COUNTIF(A1:A10,B1) returns 1.

=COUNTIF(A1:A10,">=2006") this returns 4(2006-2009).

=COUNTIF(A1:A10,"<"&B1) when B1 contains 2006 returns 6.

=COUNTIF(A1:A10,C2) where cell C2 contains the text >2006 counts the number of cells in the range A1:A10 which are >2006.

To count only negative numbers, enter =COUNTIF(A1:A10,"<0")




Trademarks | IBM Connections wiki