COUNTIF

The COUNTIF function is used to count the number of cells within a range that meet specific criteria. It is a powerful tool for analyzing data and obtaining insights based on specified conditions.

Syntax

=COUNTIF(range, criteria)

range The range of cells to be evaluated.
criteria The condition or criteria used to determine which cells to count.

About COUNTIF

When you find yourself sifting through a dataset and needing to tally the occurrences of specific values or meet particular conditions, the COUNTIF function in Excel rises to the occasion. This versatile function empowers you to specify criteria and swiftly ascertain the frequency of matching entries within a designated range of cells. Whether it's assessing the number of sales exceeding a certain threshold or quantifying the occurrences of a particular category, COUNTIF offers a straightforward means to extract meaningful statistics from your data. By providing the range of cells to be examined and the criteria to be met, COUNTIF enables you to obtain valuable insights and make informed decisions informed by the frequency of specific data points within your dataset.

Examples

Suppose you have a list of student scores in cells A2 to A11 and want to count the number of scores that are greater than or equal to 80. The COUNTIF formula would be: =COUNTIF(A2:A11, ">=80")

Suppose you have a list of customer feedback in cells C2 to C20 and want to count the occurrences of the word "excellent". The COUNTIF formula would be: =COUNTIF(C2:C20, "excellent")

Questions

Can I use wildcards in the criteria for the COUNTIF function?

Yes, wildcards such as * (asterisk) and ? (question mark) can be used in the criteria to represent one or more characters. For example, the criteria "app*" would count cells containing words like apple, application, or approach.

Is the COUNTIF function case-sensitive?

No, the COUNTIF function is case-insensitive, meaning it does not differentiate between uppercase and lowercase letters when evaluating the criteria against the data in the range.

Can I count cells based on multiple criteria using the COUNTIF function?

To count cells based on multiple criteria, you can use the COUNTIFS function, which allows for the inclusion of multiple criteria within a single formula.

Related functions

COUNTIFS
SUMIF
AVERAGEIF
SUMPRODUCT