The Excel COUNTIF function counts the number of occurrences of a condition within a range of cells. The COUNTIF function is useful for quickly counting instances of data within a dataset.
range = the range of data to test the criteria against
criteria = the criteria to test against the range of data
The COUNTIF formula returns the count cells within the range that meet the criteria.
In the example above the COUNTIF formula in cell I6 counts the number of occurences of “Jones” (from cell H6) in the range C6:C16 (the sales Representative’s names).
The result is 3, because there are three instances of Jones (one in row 6, 10, and 16).