Argument
|
Description
|
range
|
Required. This is the group of cells that you want to count. This argument can contain numbers, a named range, or references that contain numbers.
|
criteria
|
Required. This is the condition that is used to determine which cells will be counted
. This can be a cell reference, text, expression, or function. For example, you can use a number like 40, a logical comparison like ">=40", a cell reference like D10, or a word like "bolts".
|
Formula 1
|
|
Formula
|
=COUNTIF(A2:A14,"Tea")
|
Result
|
3
|
Description
|
Counts the number of cells with tea.
|
Formula 2
|
|
Formula
|
=COUNTIF(A2:A14,A4)
|
Result
|
2
|
Description
|
Counts the number of cells with peaches (the value in A4).
|
Formula 3
|
|
Formula
|
=COUNTIF(A2:A14,A2)+COUNTIF(A2:A14,A3)
|
Result
|
4
|
Description
|
Counts the number of teas and pears in A2:A14.
|
Formula 4
|
|
Formula
|
=COUNTIF(B2:B14,">20")
|
Result
|
2
|
Description
|
Counts the number of values in cells B2:B14 greater than 20.
|
Formula 5
|
|
Formula
|
=COUNTIF(B2:B14,"<>"&B7)
|
Result
|
10
|
Description
|
Counts the number of cells with a value not equal to 10 in cells B2:B14. The ampersand (&) is used for concatenation.
|
Formula 6
|
|
Formula
|
=COUNTIF(A2:A14,"T*")
|
Result
|
4
|
Description
|
Counts the number of items starting with T in cells A2:A14.
|