COUNTIFS in Excel: Count Cells That Meet Multiple Conditions

CountIFs in Excel Blogpost Feature Image
Need to count data based on more than one condition in Excel? The COUNTIFS function lets you analyze data with precision by applying multiple criteria across ranges. In this guide, learn the COUNTIFS formula, understand how it works, and explore practical examples that help you build accurate reports and insights quickly.

Need to count rows that match two conditions at once? Or three? The COUNTIFS function in Excel lets you count cells that meet multiple conditions simultaneously — across text, numbers, dates, wildcards, and even blank cells. In this guide you will learn exactly how COUNTIFS works and walk through 8 real-world examples covering every scenario you are likely to encounter, from simple two-condition counts to OR logic, date ranges, and wildcard matching.

COUNTIF vs COUNTIFS — What Is the Difference?

Before diving into examples, it helps to understand why COUNTIFS exists alongside COUNTIF:

COUNTIF
  • One condition only
  • One criteria range
  • Available since Excel 2003
  • Use for simple single-condition counts
COUNTIFS
  • Up to 127 conditions
  • Multiple criteria ranges
  • Available since Excel 2007
  • AND logic by default — all conditions must be true
Key rule: COUNTIFS applies AND logic by default. Every condition you specify must be true for a row to be counted. To apply OR logic, you need to add two COUNTIFS results together — covered in Example 6.

COUNTIFS Syntax

=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)
Argument Required? What it means
criteria_range1 Required The first column or range to evaluate against the first condition
criteria1 Required The first condition — text, number, expression, or cell reference
criteria_range2, criteria2 Optional Additional range + condition pairs. Each range must be the same size as criteria_range1. Up to 127 pairs allowed.
Critical rule: Every criteria range must be exactly the same number of rows and columns as criteria_range1. Mismatched range sizes return a #VALUE! error.

Example 1: Two Text Conditions (Region + Status)

The most common use of COUNTIFS is filtering by two text columns simultaneously — for example, counting how many orders in the North region have a status of "Completed".

Count orders where Region = "North" AND Status = "Completed"
#
A — Region
B — Status
C — Amount
1
North
Completed
$1,200
2
South
Completed
$800
3
North
Pending
$950
4
North
Completed
$2,100
5
East
Completed
$560
=COUNTIFS(A2:A6, "North", B2:B6, "Completed")
Result: 2 — Only rows 1 and 4 match both conditions. Rows 2 and 5 fail the region test; row 3 fails the status test.

Example 2: Count Between a Date Range

COUNTIFS handles date ranges by applying two conditions to the same date column — one for the start date and one for the end date. This is ideal for counting orders, tasks, or events within a specific month or quarter.

Count orders placed in January 2026
#
A — Order Date
B — Order ID
1
10-Jan-26
ORD-001
2
25-Jan-26
ORD-002
3
03-Feb-26
ORD-003
4
18-Jan-26
ORD-004
-- Using DATE function (hardcoded): =COUNTIFS(A2:A5, ">="&DATE(2026,1,1), A2:A5, "<="&DATE(2026,1,31)) -- Referencing cells E1 (start) and E2 (end): =COUNTIFS(A2:A5, ">="&E1, A2:A5, "<="&E2)
Result: 3 — Rows 1, 2 and 4 fall in January. Row 3 (February) is excluded.
Date tip: Always concatenate the operator string with an ampersand before the date value or cell reference: ">="&E1. Never put the cell reference inside the quotes — it will be treated as literal text and return zero.

Example 3: Count Numbers Between Two Values

Apply two comparison conditions to the same column to count values within a numeric range — for example, scores between 60 and 80, or salaries between two thresholds.

Count scores between 60 and 80 (inclusive)
#
A — Student
B — Score
1
Alice
55
2
Bob
72
3
Carol
60
4
Dan
91
5
Eve
80
-- Count scores >= 60 AND <= 80: =COUNTIFS(B2:B6, ">=60", B2:B6, "<=80") -- Using cell references for flexible thresholds (E1=60, E2=80): =COUNTIFS(B2:B6, ">="&E1, B2:B6, "<="&E2)
Result: 3 — Bob (72), Carol (60) and Eve (80) fall within the range. Alice (55) and Dan (91) are excluded.
Exclusive vs inclusive: Use ">=" and "<=" to include the boundary values. Use ">" and "<" to exclude them. In the example above, Carol (60) and Eve (80) are included because of the equals signs.

Example 4: Wildcard Matching with *

COUNTIFS supports the * wildcard (any sequence of characters) and ? (exactly one character). This is useful when you need to count partial text matches — product families, department prefixes, or customer name patterns.

Count "Completed" orders where Product starts with "Laptop"
#
A — Product
B — Status
Match?
1
Laptop 15"
Completed
✓ Yes
2
Laptop Pro
Completed
✓ Yes
3
Monitor 27"
Completed
— No
4
Laptop Air
Pending
— No
=COUNTIFS(A2:A5, "Laptop*", B2:B5, "Completed")
Result: 2 — Rows 1 and 2 match. Row 3 fails the product test; row 4 fails the status test.
Wildcard cheat sheet:  "Laptop*" starts with Laptop  |  "*Pro*" contains Pro  |  "???-2026" three chars then -2026  |  "~*" literal asterisk

Example 5: Three Conditions Combined

COUNTIFS scales effortlessly to three or more conditions — common in HR dashboards (department + grade + status), sales reporting (region + product + rep), and project tracking (priority + owner + phase).

Count Sales team, Senior grade, Active employees
#
A — Dept
B — Grade
C — Status
Match?
1
Sales
Senior
Active
✓ Yes
2
HR
Senior
Active
— No
3
Sales
Senior
Active
✓ Yes
4
Sales
Junior
Active
— No
5
Sales
Senior
On Leave
— No
=COUNTIFS(A2:A6, "Sales", B2:B6, "Senior", C2:C6, "Active")
Result: 2 — Only rows 1 and 3 pass all three conditions.

Example 6: OR Logic — Count Either Condition

COUNTIFS applies AND logic by default, so getting OR logic requires one of two techniques: adding two COUNTIFS results together, or using an array constant inside SUM.

Count orders where Status = "Completed" OR Status = "Shipped"
-- Method 1: Add two COUNTIFS (easiest to read): =COUNTIFS(B2:B100, "Completed") +COUNTIFS(B2:B100, "Shipped") -- Method 2: SUM + array (scales to many values): =SUM(COUNTIFS(B2:B100, {"Completed","Shipped","Delivered"})) -- OR + second condition (Region = "North" AND status is either): =SUM(COUNTIFS(A2:A100, "North", B2:B100, {"Completed","Shipped"}))
Method 1 vs Method 2: Method 1 is clearest for two options. Method 2 with an array constant is better when you have three or more OR values — just extend the array. Both methods produce the same result for non-overlapping criteria.
Double-counting risk: If a row could match more than one OR value (e.g. a cell tagged as both "Completed" and another matching condition), Method 1 will count that row twice. Use SUMPRODUCT with ISNUMBER(MATCH(...)) for deduplication in those edge cases.

Example 7: Count Blank and Non-Blank Cells

COUNTIFS can detect blank and non-blank cells using special criteria strings. This is useful for auditing data completeness — for example, finding tasks that have no assigned owner, or employees with a missing department.

Count tasks that are "In Progress" but have no assigned owner
#
A — Task
B — Status
C — Owner
1
Design mockup
In Progress
Ana
2
Write copy
In Progress
(blank)
3
QA testing
Done
(blank)
4
Deploy build
In Progress
(blank)
-- Count "In Progress" rows with no owner assigned: =COUNTIFS(B2:B5, "In Progress", C2:C5, "") -- Count "In Progress" rows that DO have an owner: =COUNTIFS(B2:B5, "In Progress", C2:C5, "<>")
Result: 2 — Rows 2 and 4 are "In Progress" with no owner. Row 1 has an owner; row 3 has status "Done".

Example 8: Dynamic Criteria from Dropdown Cells

Hard-coded criteria work for one-off counts, but dashboards need to update dynamically. Reference cells (ideally connected to Data Validation dropdowns) so that changing the filter value updates every COUNTIFS formula instantly.

Dashboard filter: criteria driven by user-selected cells
#
E — Label
F — User selects
1
Region filter
North ← dropdown
2
Status filter
Completed ← dropdown
3
Count
=COUNTIFS(…) → auto-updates
-- Reference cells F1 and F2 instead of hardcoded text: =COUNTIFS(A2:A1000, F1, B2:B1000, F2) -- Partial match from a dropdown cell (starts-with): =COUNTIFS(A2:A1000, F1&"*", B2:B1000, F2) -- "All" option: use "" in F1 to match every region: =COUNTIFS(A2:A1000, IF(F1="All","*",F1), B2:B1000, F2)
Dashboard tip: Add Data Validation to cells F1 and F2 (Data → Data Validation → List). Users pick from a predefined dropdown and every COUNTIFS in your dashboard updates without anyone touching the formulas.

Quick-Reference: All Comparison Operators in COUNTIFS

Goal Criteria syntax Example
Equal to text "North" =COUNTIFS(A:A, "North")
Equal to cell value "="&A1 =COUNTIFS(A:A, "="&E1)
Not equal to "<>Cancelled" =COUNTIFS(B:B, "<>Cancelled")
Greater than ">100" =COUNTIFS(C:C, ">100")
Greater than or equal ">="&E1 =COUNTIFS(C:C, ">="&E1)
Less than or equal "<="&E2 =COUNTIFS(C:C, "<="&E2)
Blank / empty "" =COUNTIFS(D:D, "")
Not blank "<>" =COUNTIFS(D:D, "<>")
Starts with (wildcard) "North*" =COUNTIFS(A:A, "North*")
Contains (wildcard) "*Pro*" =COUNTIFS(A:A, "*Pro*")

Troubleshooting: Why Is COUNTIFS Returning Zero?

If COUNTIFS returns 0 when you expect a positive number, work through these five common causes in order:

1. Criteria ranges are different sizes

Every criteria range must be exactly the same number of rows and columns as the first range. If criteria_range1 is A2:A100, then criteria_range2 must also be exactly 99 rows. A mismatched size returns #VALUE!.

2. Numbers stored as text

A numeric criteria like ">50" will not match cells that contain numbers formatted as text (look for the green triangle in the top-left corner of the cell). Fix: select the column → Data → Text to Columns → Finish.

3. Extra spaces in cell values

A cell containing "North " (trailing space) will not match the criteria "North". Clean your data with TRIM() or use a wildcard as a workaround: "North*".

4. Dates stored as text

Date comparison criteria only work when the dates in your column are genuine Excel serial dates. Press Ctrl+` to toggle formula view — real dates show as 5-digit numbers. Text-formatted dates will not match ">="&DATE(...).

5. Operator outside the quotes

This is wrong: =COUNTIFS(A:A, >"North"). Operators must be inside quotes, concatenated with & when combining with a cell reference: =COUNTIFS(B:B, ">"&E1).

COUNTIFS is case-insensitive: "north", "NORTH", and "North" all match the same cells. If you need a case-sensitive count, use =SUMPRODUCT((EXACT(A2:A100,"North"))*(B2:B100="Completed")) instead.

Frequently Asked Questions

  • COUNTIF counts cells that meet a single condition in one range. COUNTIFS counts cells that meet multiple conditions across one or more ranges, using AND logic by default — every condition must be true for a row to be counted. COUNTIFS is available from Excel 2007 onwards.
  • Yes. Add two COUNTIFS results together to apply OR logic: =COUNTIFS(…) + COUNTIFS(…). For multiple OR values in the same column, use =SUM(COUNTIFS(range, {"A","B","C"})) with an array constant. Both methods count rows matching either condition.
  • Yes. Apply two criteria pairs to the same date column: =COUNTIFS(A:A, ">="&E1, A:A, "<="&E2). Ensure dates are stored as real Excel serial dates and not text strings — press Ctrl+` to verify.
  • The most common causes are: criteria ranges with different sizes, numbers stored as text, extra trailing spaces in cell values, dates formatted as text, or a comparison operator placed outside the quote marks. Work through each in order — see the troubleshooting section above.
  • Use "" to count blank cells and "<>" to count non-blank cells. Combine with other criteria: =COUNTIFS(B:B, "In Progress", C:C, "") counts "In Progress" rows with a blank owner column.
  • Yes. Use * for any sequence of characters and ? for a single character. For example, "Laptop*" matches Laptop, Laptop Pro, Laptop 15", etc. To match a literal asterisk, prefix it with a tilde: "~*".