Countifs Function in Excel to Count Cells Meeting Multiple Criteria in Excel


The COUNTIFS function in Excel is a powerful tool that allows you to count the number of cells in a range that meet multiple criteria. It is a variation of the COUNTIF function, which counts the number of cells in a range that meet a single criterion.

Syntax

=COUNTIFS(range1, criteria1, range2, criteria2, ...)

Where:

  • range1 is the first range of cells that you want to count.
  • criteria1 is the condition or criterion that the cells in range1 must meet in order to be counted.
  • range2 is an optional second range of cells that you want to count.
  • criteria2 is the condition or criterion that the cells in range2 must meet in order to be counted.

You can add more ranges and criteria pairs to the function by separating them with commas. Each additional pair adds another condition that the cells must meet in order to be counted.

For example

=COUNTIFS(C2:C11, G3, D2:D11, G4)

The formula =COUNTIFS(C2:C11,G3,D2:D11,G4) counts the number of rows in the range C2:C11 where the value in the cell matches the value in cell G3, and the corresponding value in the range D2:D11 matches the value in cell G4. Essentially, it's a count of the number of rows that meet both criteria.

Assuming that contains a list of genders (e.g. "Male" or "Female") and contains a list of cities (e.g. "Salem" or "Chennai"), the formula will count the number of rows where the gender is equal to the value in cell G3 and the city is equal to the value in cell G4.

The cell G3 contains "Male" and cell G4 contains "Salem", the formula will count the number of rows where the gender is "Male" and the city is " Salem " in the specified range (C2:C11 and D2:D11).

Output