You can use the COUNTIF and COUNTIFS functions in Excel to count the number of values in one column where the value in another column meets specific criteria.
The following examples show how to use these functions in practice with the following dataset in Excel:
Let’s jump in!
Example 1: Use COUNTIF to Count One Column if Another Column Meets Criteria
We can type the following formula into cell D2 to count the number of cells in the Player column where the corresponding cell in the Team column is equal to “Mavs”:
=COUNTIF(A2:A11, F1)
The following screenshot shows how to use this formula in practice:
From the output we can see that there are 4 cells in the Player column where the corresponding cell in the Team column is Mavs.
Example 2: Use COUNTIFS to Count One Column if Multiple Other Columns Meet Criteria
We can type the following formula into cell D2 to count the number of cells in the Player column where the corresponding cell in the Team column is equal to “Mavs” and the corresponding cell in the Points column is greater than 20:
=COUNTIFS(A2:A11, F1, C2:C11, ">"&F2)
The following screenshot shows how to use this formula in practice:
From the output we can see that there are 2 cells in the Player column where the corresponding cell in the Team column is Mavs and the corresponding cell in the Points column is greater than 20.
Note: In this example we used the COUNTIFS function to check if two columns met specific criteria, but you can use the COUNTIFS function to check if as many columns as you’d like meet specific criteria.
Additional Resources
The following tutorials explain how to perform other common operations in Excel:
Excel: Use COUNTIF with Multiple Ranges
Excel: Use COUNTIF with Multiple Criteria in Same Column
Excel: COUNTIF Greater Than But Less Than Some Number