Table of Contents
Introduction: The Power of Conditional Counting in Excel
In the dynamic world of data management and quantitative analysis, Microsoft Excel remains an essential, powerful tool. Its extensive collection of built-in functions enables users to conduct sophisticated calculations and extract actionable intelligence from large, complex datasets. A fundamental requirement in almost every analytical project is the ability to count cells based on specific, predefined conditions. While straightforward counting tasks are simple, real-world data analysis frequently demands tallying entries that satisfy multiple criteria simultaneously. This necessity highlights the superior capabilities of the advanced function, COUNTIFS.
This comprehensive guide focuses on a specific, highly practical application of the COUNTIFS function: counting numerical entries that exist within a precisely defined numerical range. Specifically, we will demonstrate how to efficiently count values that are simultaneously greater than a specified lower limit and less than an upper limit. This technique is critical for various tasks, including segmenting operational data, identifying records that fall into specific performance brackets, or isolating statistical outliers that lie just outside expected thresholds.
By mastering the concepts presented in this tutorial, you will gain a deep understanding of the COUNTIFS function’s logical structure and syntax. We will walk through the construction of robust formulas for range-bound counting and provide practical, step-by-step examples derived from realistic data analysis scenarios. This expertise is vital for moving beyond basic spreadsheet operations and leveraging Microsoft Excel for more sophisticated, dynamic data queries.
Understanding the COUNTIFS Function
The COUNTIFS function is one of the most versatile functions within the Excel suite, engineered specifically to count the number of cells within a designated range that satisfy two or more distinct criteria. This multiple-condition capability sets it apart from the simpler COUNTIF function, which is limited to processing only a single condition. COUNTIFS allows for up to 127 condition pairs, providing unprecedented granularity for data filtration and aggregation.
The formalized syntax for utilizing the COUNTIFS function is highly structured, requiring alternating arguments of ranges and their corresponding criteria:
=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)To ensure successful implementation, it is essential to understand the purpose of each component within the function:
- criteria_range1 (required): This is the initial range of cells that the function will evaluate. This range must be consistent in size and shape with any subsequent criteria ranges if they are included.
- criteria1 (required): This argument specifies the specific condition that cells in criteria_range1 must meet to be counted. The criteria can be expressed as a raw number, a reference to another cell, a text string, or, most commonly for numerical tasks, an expression utilizing comparison operators. These operators include greater than (`>`), less than (`<`), equal to (`=`), not equal to (`<>`), greater than or equal to (`>=`), or less than or equal to (`<=`). Note that all expressions and text criteria must be enclosed within double quotation marks.
- criteria_range2, criteria2, … (optional): These pairs allow you to introduce additional conditions. You can extend the function up to 127 pairs of ranges and corresponding criteria.
A crucial concept to grasp is that COUNTIFS operates under strict “AND” logic. This means that a cell will only be included in the final tally if it successfully satisfies *every single condition* provided within the formula. This inherent characteristic is precisely what makes it the ideal function for counting values that must simultaneously satisfy both a lower boundary constraint and an upper boundary constraint.
Implementing Range-Bound Counting with COUNTIFS
The core challenge of counting data points that fall within a defined numerical range requires a logical structure that verifies two distinct facts about the same data point: that it is greater than the minimum threshold AND less than the maximum threshold. Since COUNTIFS is built upon “AND” logic, it provides the most direct and efficient solution for this task.
To achieve a count where values are greater than a lower bound (X) and less than an upper bound (Y), we must utilize two separate condition pairs within the same COUNTIFS function. Both pairs must reference the exact same column or range of data. For instance, if your objective is to count all numerical values in column B that exceed 15 but are strictly less than 25, the formula construction is straightforward and highly descriptive:
=COUNTIFS(B:B,">15",B:B,"<25")
Analyzing the formula structure above reveals the mechanism of dual criteria application:
- The first condition, `B:B, “>15″`, establishes the lower limit. It instructs COUNTIFS to only accept cells in column B whose value is strictly greater than 15.
- The second condition, `B:B, “<25″`, establishes the upper limit. It mandates that the same cells in column B must also have a value strictly less than 25.
Only those cells that successfully pass both validation checks will be aggregated in the final result. This elegant methodology allows for the precise segmentation of numerical data, ensuring that your data analysis is based on clearly defined, boundary-specific ranges.
Practical Example: Analyzing Performance Data
To solidify the understanding of range-bound counting, let us examine a tangible scenario using performance metrics. Consider a spreadsheet tracking basketball player performance, where we need to categorize players based on their scoring output. Our specific goal is to determine how many recorded scores fall into a “mid-tier performance” bracket—defined as greater than 15 points but less than 25 points.
Assume your Excel worksheet is structured with player names in column A and their corresponding game scores in column B, as visualized below:

We are tasked with counting the entries in the “Points” column (B) that satisfy the range criteria (greater than 15 AND less than 25). Based on this numerical condition, we are looking for scores between 16 and 24, inclusive. A best practice is to restrict the formula to the actual data area, which in this case is the range B2:B11, thereby excluding the header row (B1) and any empty cells below the dataset.
The precise formula required to execute this mid-tier performance count is:
=COUNTIFS(B2:B11,">15",B2:B11,"<25")
By using the specific data range B2:B11 instead of the entire column B:B, we ensure accuracy and avoid potential errors caused by non-numeric values. Entering this formula into an empty cell within your worksheet will instantly yield the count of scores that fall within the specified boundaries. The subsequent image illustrates the input of this formula and the calculated output generated by Excel:

Verifying and Interpreting the Results
After successfully applying the formula =COUNTIFS(B2:B11,">15",B2:B11,"<25") to the basketball scores dataset, Excel produces a result of 3. This numerical output signifies that three specific cells within the defined range, B2:B11, simultaneously satisfy both criteria: the value is greater than 15 AND the value is less than 25.
While the COUNTIFS function is highly reliable and mathematically precise, a crucial step in any robust data analysis process is the manual verification of results. This step is especially important when dealing with critical data or when first learning the nuances of complex conditional formulas, as it confirms that the interpretation of the criteria aligns perfectly with the formula’s execution.
We can manually scrutinize the “Points” column to confirm the counted values. Our search targets scores that strictly fall between 15 and 25 (i.e., excluding the endpoints 15 and 25).

As visually highlighted in the confirmation image above, the scores that successfully meet the dual conditions are:
- 18 (Satisfies: >15 and <25)
- 24 (Satisfies: >15 and <25)
- 20 (Satisfies: >15 and <25)
The manual confirmation yields a total of 3 qualifying scores, perfectly corroborating the result generated by our COUNTIFS formula. This validation process ensures the integrity and trustworthiness of your subsequent reports and analysis.
Advanced Flexibility and Related Conditional Functions
While the previous examples focused on exclusive ranges (greater than X, less than Y), the COUNTIFS function provides complete control over boundary inclusion. If your analytical needs require counting cells that are greater than or equal to the lower bound AND less than or equal to the upper bound, a simple adjustment of the comparison operators is all that is needed:
=COUNTIFS(B:B,">=15",B:B,"<=25")This modification allows precise control over whether the endpoints of your numerical range are included in the count, satisfying diverse reporting requirements. Furthermore, one of the most powerful features of conditional functions is the ability to use dynamic references. Instead of embedding fixed numerical values (hardcoding) like 15 and 25 directly into the formula, you can reference the contents of other cells. For example, if cell D1 holds the lower limit (15) and cell E1 holds the upper limit (25), the formula becomes dynamic:
=COUNTIFS(B:B,">"&D1,B:B,"<"&E1)The use of the ampersand (`&`) operator concatenates the comparison operator (e.g., `>`) with the dynamic cell reference (e.g., `D1`). This technique is foundational for developing interactive spreadsheet interfaces, allowing end-users to change the criteria bounds merely by updating a cell value without ever touching the underlying formula logic. Beyond counting, Excel offers similar conditional aggregation functions essential for advanced data analysis:
- SUMIFS: This function conditionally sums values across a range based on meeting multiple criteria.
- AVERAGEIFS: This calculates the conditional average of values in a range based on multiple criteria.
Conclusion: Mastering Conditional Aggregation
The ability to master conditional functions, particularly COUNTIFS, represents a significant step forward in your proficiency with Excel. We have demonstrated how a seemingly complex requirement—counting numerical values within a specific range (greater than X but less than Y)—can be resolved using a concise, powerful, and efficient formula structure. A solid understanding of syntax and the underlying “AND” logic allows you to unlock sophisticated data segmentation and reporting capabilities.
We strongly encourage practitioners to continue experimenting with various criteria and different datasets. The core principles of combining comparison operators and ranges, as learned here, are transferable across countless analytical challenges, ultimately fortifying your overall data analysis skillset.
For those seeking to explore more common tasks and advanced functionalities in Excel, dedicated resources and tutorials are available for deeper dives into related conditional aggregation methods:
Cite this article
Mohammed looti (2025). Learning to Use COUNTIF with Multiple Criteria in Excel: Counting Values Within a Range. PSYCHOLOGICAL STATISTICS. Retrieved from https://statistics.arabpsychology.com/excel-countif-greater-than-but-less-than-some-number/
Mohammed looti. "Learning to Use COUNTIF with Multiple Criteria in Excel: Counting Values Within a Range." PSYCHOLOGICAL STATISTICS, 30 Oct. 2025, https://statistics.arabpsychology.com/excel-countif-greater-than-but-less-than-some-number/.
Mohammed looti. "Learning to Use COUNTIF with Multiple Criteria in Excel: Counting Values Within a Range." PSYCHOLOGICAL STATISTICS, 2025. https://statistics.arabpsychology.com/excel-countif-greater-than-but-less-than-some-number/.
Mohammed looti (2025) 'Learning to Use COUNTIF with Multiple Criteria in Excel: Counting Values Within a Range', PSYCHOLOGICAL STATISTICS. Available at: https://statistics.arabpsychology.com/excel-countif-greater-than-but-less-than-some-number/.
[1] Mohammed looti, "Learning to Use COUNTIF with Multiple Criteria in Excel: Counting Values Within a Range," PSYCHOLOGICAL STATISTICS, vol. X, no. Y, ص Z-Z, October, 2025.
Mohammed looti. Learning to Use COUNTIF with Multiple Criteria in Excel: Counting Values Within a Range. PSYCHOLOGICAL STATISTICS. 2025;vol(issue):pages.