
π This article includes 2 downloadable practice files β
In this article
COUNTIFS counts rows where every condition is true.
Syntax
=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)
| Argument | What it means |
|---|---|
criteria_range1, criteria1 |
First range and condition. |
Examples
Example 1
=COUNTIFS(B:B, "North", E:E, ">=50000")
Big North orders.
Example 2
=COUNTIFS(A:A, ">="&G1, A:A, "<="&G2)
Rows between two dates.
COUNTIFS in practice
Where you will use it
- Orders from North above βΉ10,000
- Employees in Pune with rating 4+
- Tickets open more than 7 days for one team
Worked example
Orders above βΉ10,000 in the same region as the row.
| Region | Amount | Formula | Result |
|---|---|---|---|
| North | 15000 | =COUNTIFS($A$2:$A$4,A2,$B$2:$B$4,">10000") | 1 |
| North | 8000 | =COUNTIFS($A$2:$A$4,A3,$B$2:$B$4,">10000") | 1 |
| South | 22000 | =COUNTIFS($A$2:$A$4,A4,$B$2:$B$4,">10000") | 1 |
Results calculated in Excel.
Mistakes people make
| Mistake | What to do instead |
|---|---|
| Ranges of different sizes | All ranges must have the same rows |
| Expecting OR logic | COUNTIFS is AND; add two COUNTIFS for OR |
Related functions
COUNTIF Β· SUMIFS Β· AVERAGEIFS
π Part of the free Excel course: Beginner β Expert Β· Try it in the Formula Lab or ask the AI Helper.
Test formulas dynamically in our web formula laboratory or download the companion Excel workbook.
π Practice files for this article
β¬ Download all 2 files (ZIP Β· 38 KB)
- πSUMIFS/COUNTIFS scenarios workbookConditional sums and counts with dates, OR logic and wildcards, plus 4 classic reasons totals come out wrong β all with PASS/FAIL checks.β¬ XLSX Β· 9 KB
- πPractice workbook: Statistics basics22 tasks on realistic sales data β type your formula, the Check column turns green when it is right. Answers sheet included.β¬ XLSX Β· 34 KB
Free to use for learning. Files with macros (.bas) are plain text β import them with Alt+F11 β File β Import File, and always test on a copy.
Atul (AJ) builds office-automation and local-first AI tools as Atulya AI, and works with Excel, SAP and Oracle EPM every day. He writes about the shortcuts, macros and automations that actually save time β plus the occasional wacky fact. Videos on YouTube: Lazy Automator AI (@LazyAutomatorAI).
More posts by Atul βBuild this skill next
This page is a quick function reference. Use it for syntax, then practise the function in a broader workflow.
Stuck on a step? Ask a question and the AI answers using this article.