- Advanced Excel Functions Tutorial
- Advanced Excel Functions - Home
- Compatibility Functions
- Advanced Excel Functions - Cube
- Database Functions
- Date & Time Functions
- Engineering Functions
- Financial Functions
- Information Functions
- Advanced Excel Functions - Logical
- Lookup & Reference Functions
- Math & Trignometric Functions
- Statistical Functions
- Useful Resources
- Quick Guide
- Useful Resources
- Discussion
Statistical - COUNTIFS Function
Description
The COUNTIFS function applies multiple criteria to cells across multiple ranges and counts the number of times all criteria are met.
Syntax
COUNTIFS (criteria_range1, criteria1, [criteria_range2, criteria2]…)
Arguments
Argument | Description | Required/ Optional |
---|---|---|
criteria_range1 | The first range in which to evaluate the associated criteria. | Required |
criteria1 | The criteria in the form of a number, expression, cell reference, or text that define which cells will be counted. | Required |
criteria_range2, criteria2, ... | Additional ranges and their associated criteria. Up to 127 range/criteria pairs are allowed. | Optional |
Notes
Each additional range must have the same number of rows and columns as the criteria_range1 argument.
The ranges do not have to be adjacent to each other.
Each range's criteria is applied one cell at a time. If all of the first cells meet their associated criteria, the count increases by 1. If all of the second cells meet their associated criteria, the count increases by 1 again, and so on until all of the cells are evaluated.
If the criteria argument is a reference to an empty cell, the COUNTIFS Function treats the empty cell as a 0 value.
You can use the wildcard characters the question mark (?) and asterisk (*) in criteria. A question mark matches any single character, and an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.
If all the supplied criteria_range arrays do not have equal length, COUNTIFS returns #VALUE! Error value.
If any of the specified criteria arguments are text strings that are greater than 255 characters long, COUNTIFS returns #VALUE! Error value.
Applicability
Excel 2007, Excel 2010, Excel 2013, Excel 2016