Countif Function Excel

How to Use the COUNTIF Function in Excel: A Guide for Beginners

When it comes to working with complex formulas, Excel's built-in functions and mini-formulas make it a breeze. Amongst these useful tools is the COUNTIF function, which allows users to easily count the number of cells with specific values or ranges. In this article, we'll guide you through the steps to using the COUNTIF function in Excel.

The Basics of the COUNTIF Function

The COUNTIF function in Excel counts the number of cells in a range that meet certain criteria, unlike other formulas that calculate a total. This makes it incredibly useful for counting cells with specific values or ranges. Let's walk through how to use it together.

Step-by-Step Guide to Using the COUNTIF Function

1. Start with =COUNTIF()

To use the COUNTIF function, simply enter =COUNTIF() in the cell where you want the answer to appear.

2. Define the Range of Cells

The next step is to enter two arguments within the parentheses - the range of cells you want to count and the criteria you want to match. You can manually type in the range (e.g. D1-D20) or highlight it with your mouse. For example, if your values are in column D from row 1 to row 20, the function will look like this: =COUNTIF(A2-A35).

3. Define the Search Criteria

After the comma, add the criteria or value you want to count, surrounded by quotation marks. For example, if you want to count the number of vegetables on your list, your criteria would be "Vegetable", and your function would look like this: =COUNTIF(A2-A35, "Vegetable").

Tips for Using the COUNTIF Function

Besides counting specific values, there are several other ways to utilize the COUNTIF function. Here are three tips to help you make the most out of this powerful tool.

Use Wildcard Characters for Partial Matches

You don't always have to specify a specific value or criteria. By using the * wildcard character, you can match any value in that part of the string. For example, if you have a list of addresses and want to count all ZIP codes that start with 46 (such as 46032, 46033, and 46450), you can enter 46* to match any value that begins with 46. The function would look like this: =COUNTIF(D1-D20,"46*"). You can also use the wildcard character at the end of the value string. For instance, to count all cells that end with the letters "polis", enter *polis, which would count cities like Indianapolis and Minneapolis.

Count Values Greater or Less Than a Number

To count cells with values greater than a specified number, use the formula =COUNTIF(D1-D20,">10"). To count cells greater than or equal to a number, use =COUNTIF(D1-D20, ">=10"). Similarly, for cells with values less than a given number, use =COUNTIF(D1-D20, "<10"), and for values less than or equal to a number, use =COUNTIF(D1-D20, "<=10"). You can also count cells with values not equal to a specific number by using <> before the number, like this: =COUNTIF(D1-D20,"<>10").

Count Cells with Multiple Criteria

You can also count cells with multiple criteria by using multiple COUNTIF functions separated by the + sign. For example, to count customers who live in either Los Angeles or San Diego, you can use =COUNTIF(D1-D20,"Los Angeles")+COUNTIF(D1-D20,"San Diego"). You can add even more criteria by including another + and COUNTIF function.

To take your Excel skills to the next level, check out our article on how to use Excel like a pro. Discover 29 powerful tips, tricks, and shortcuts that will make your Excel experience even smoother and more efficient.

Quiz questions showing the correct answer and a leaderboard with friends.

Create marketing notes and questions for free

96% of learners report doubling their learning speed with Shiken

Join Shiken for free

Try Shiken Premium for free

Start creating interactive learning content in minutes with Shiken. 96% of learners report 2x faster learning.
Try Shiken for free
Free 7 day trial
Cancel anytime
30k+ learners globally
Shiken UI showing questions and overall results.

Explore other topics