Count cells that match multiple criteria
=COUNTIFS(range1, criteria1, [range2], [criteria2], ...)
| Parameter | Description |
|---|---|
range1 |
The first range to evaluate. |
criteria1 |
The criteria to use on range1. |
range2 |
[optional] The second range to evaluate. |
criteria2 |
[optional] The criteria to use on range2. |
The COUNTIFS function counts the number of cells in a range that meet one or more conditions. The syntax depends on the number of conditions being eva
=COUNTIFS(range,criteria) // 1 condition
=COUNTIFS(range,criteria,range,criteria) // 2 conditions
The four formulas in I5:I8 look like this:
=COUNTIFS(C5:C16,"red")
=COUNTIFS(C5:C16,"red",D5:D16,"TX")
=COUNTIFS(C5:C16,"red",F5:F16,">20")
=COUNTIFS(C5:C16,"red",F5:F16,">20",D5:D16,"TX")
It is often convenient to put criteria in another cell and then refer to this cell inside your formula. This makes it easy to change criteria later wi
=COUNTIFS(range,A1)
When a condition requires an operator, you must concatenate the cell reference to the operator. For example, to count cells in a range greater than A1
=COUNTIFS(range,">"&A1)
Note we are joining the ">" operator to cell A1 with an ampersand (&) character. In the worksheet below, COUNTIFS has been configured to return the co
=COUNTIFS(D5:D9,">"&G4) // count if greater than G4
=COUNTIFS(B5:B9,"<>red") // not red
=COUNTIFS(B5:B9,"<>blue") // not blue
=COUNTIFS(B5:B9,"<>"&E7) // not E7