COUNTIF function

The COUNTIF function in Excel is a useful tool for counting the number of cells in a range that meets a specific condition. It allows you to quickly tally up data points that match a particular criterion, making it a valuable function for data analysis and reporting.


=COUNTIF(range, [criteria])


rangeThe range of cells you want to count values in.
[criteria](Optional) The condition you want to apply for counting. It can be a specific value, expression, or text enclosed in double quotes.

How to Use

The COUNTIF function is straightforward to use. Here are some examples to illustrate its application:

Example 1: Count the number of “Apples” in a list of fruits:

This formula counts the number of cells in the range A1 to A10 that contain the text “Apples.”

Example 2: Count the values greater than 50 in a range:

This formula counts the cells in the range B1 to B10 that have values greater than 50. The “>” symbol is used to indicate the condition.

Example 3: Count cells with a specific text pattern using wildcards:

This formula counts cells in the range C1 to C10 that start with “A” and end with any character, such as “Apple” or “App.” The asterisk (*) acts as a wildcard for matching any number of characters.

Example 4: Count cells with a specific condition using cell references:

In this formula, the COUNTIF function counts cells in the range D1 to D10 that meet a condition defined in cell E1. This allows you to change the condition easily by altering the value in E1.

With the COUNTIF function, you can perform various counting tasks efficiently and customize them to your specific needs. It’s a versatile tool that simplifies data analysis in Excel.

Tomasz Decker is an Excel specialist, skilled in data analysis and financial modeling.