Countif function
From wiki.ucalgary.ca
Countif function
Countif(range,criteria) counts the no of values in the specified range which satisfies criteria. For example, countif(a2:a10,6) will give the result how many times 6 occurs in the range a2 to a10.
example#2, =countif(d3:d20, "apples")will give the result how many times apples occurs in the range d3 to a20.
example#3, =countif(f3:g3, a4)will give the result how many times the value in a4 occurs in the row f3 to h3.
example#4, =countif(A1:A8,">=2") will give the result how many values occur in the range a1 to a8 which are greater or equal to 2.