Intro
The Excel COUNTIF function is a powerful tool for counting cells that meet specific criteria within a range. One of its most useful applications is counting cells that fall within a specified range. This can be particularly handy for tasks like tracking inventory levels, monitoring temperatures, or analyzing scores that need to be within a certain threshold. In this article, we will delve into how to use the COUNTIF function to count cells between a range in Excel.
To start, let's understand the basic syntax of the COUNTIF function. The general formula is COUNTIF(range, criteria)
, where range
is the range of cells you want to check, and criteria
is the condition that must be met. For counting between a range, we typically use multiple criteria or combine COUNTIF with other functions to achieve our goal.
Using COUNTIF for a Single Range

Before diving into counting between two ranges, let's look at how to count cells within a single range. Suppose you have a list of scores in column A, from A1 to A10, and you want to count how many scores are above 80. The formula would be =COUNTIF(A1:A10, ">80")
. This will return the number of cells in the range A1:A10 that contain values greater than 80.
Counting Between Two Ranges

To count cells that fall between two values, say between 80 and 90, you can use the COUNTIF function twice and then sum the results, or you can use the COUNTIFS function, which is an extension of COUNTIF that allows for multiple criteria ranges and criteria. The COUNTIFS function syntax is COUNTIFS(range1, criteria1, [range2], [criteria2],...)
.
For example, to count scores between 80 and 90 (inclusive), you can use =COUNTIFS(A1:A10, ">=80", A1:A10, "<=90")
. This formula counts the number of cells in the range A1:A10 that are greater than or equal to 80 and less than or equal to 90.
Practical Examples
Here are a few practical examples to illustrate the use of COUNTIF and COUNTIFS for counting between ranges:- Example 1: Counting the number of days with temperatures between 20°C and 25°C in a given month. Assuming the temperatures are listed in column B (B1:B30), the formula would be
=COUNTIFS(B1:B30, ">=20", B1:B30, "<=25")
. - Example 2: Counting the number of products with prices between $50 and $100. If the prices are in column C (C1:C50), the formula would be
=COUNTIFS(C1:C50, ">=50", C1:C50, "<=100")
.
Using COUNTIF with Other Functions

Sometimes, you might need to combine COUNTIF with other Excel functions to achieve more complex counting tasks. For example, you might want to count cells that meet multiple criteria, including being within a certain range and also meeting another condition.
Combining Criteria
To combine criteria, such as counting scores that are between 80 and 90 and also belong to a specific category, you can use the COUNTIFS function with multiple criteria. For instance, if the scores are in column A and the categories are in column B, and you want to count scores between 80 and 90 for the category "Math", the formula would be `=COUNTIFS(A1:A10, ">=80", A1:A10, "<=90", B1:B10, "Math")`.Gallery of Excel COUNTIF Examples
Excel COUNTIF Examples










Frequently Asked Questions
What is the difference between COUNTIF and COUNTIFS?
+COUNTIF is used for counting cells based on a single criteria, while COUNTIFS allows for multiple criteria ranges and criteria, making it more versatile for complex counting tasks.
How do I count cells that are between two values in Excel?
+You can use the COUNTIFS function with two criteria, one for the lower bound and one for the upper bound, like this: `=COUNTIFS(range, ">=lower_bound", range, "<=upper_bound")`.
Can I use COUNTIF to count cells based on multiple conditions?
+Yes, by using the COUNTIFS function, you can specify multiple ranges and criteria to count cells that meet all the conditions.
In conclusion, mastering the COUNTIF and COUNTIFS functions in Excel can significantly enhance your data analysis capabilities, especially when it comes to counting cells between ranges. By understanding how to apply these functions, you can tackle a wide range of tasks, from simple counting to complex data analysis, with ease and precision. Whether you're a beginner or an advanced Excel user, the versatility of these functions makes them indispensable tools in your Excel toolkit. So, go ahead and explore the possibilities of COUNTIF and COUNTIFS in your Excel journey!