ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Comparisons
  3. COUNTIFS vs SUMPRODUCT for Counting With Conditions

COUNTIFS vs SUMPRODUCT for Counting With Conditions

By ExcelReady Team·Updated November 1, 2026·8 min read

The short answer

Use COUNTIFS for most conditional counts: it is fast, easy to read and handles several AND conditions and wildcards. Use SUMPRODUCT when COUNTIFS can't express the test, such as OR logic in one formula, comparing two columns row by row, or applying a function like MONTH or LEFT to a column before checking it.

Key takeaways

  • COUNTIFS counts rows that meet every condition, using ranges and criteria like ">=3" or "K*".
  • SUMPRODUCT counts with tests like (A2:A9="North")*(D2:D9>=3), where * means AND and + means OR.
  • Only SUMPRODUCT can compare two columns row by row or test MONTH(B2:B9)=3 directly.
  • COUNTIFS supports wildcards and is faster on large data; SUMPRODUCT does not support wildcards.
On this page+
  1. COUNTIFS vs SUMPRODUCT at a glance
  2. How COUNTIFS counts
  3. How SUMPRODUCT counts
  4. The same counts done both ways
  5. When to use COUNTIFS
  6. When to use SUMPRODUCT
  7. Common mistakes with COUNTIFS and SUMPRODUCT
  8. Our recommendation
  9. Practise it

The short answer to COUNTIFS vs SUMPRODUCT: use COUNTIFS for most counts with conditions, because it is fast, readable and handles several AND conditions and wildcards. Switch to SUMPRODUCT when COUNTIFS can't express the test: OR logic in one formula, comparing two columns row by row, or checking a calculated value such as the month of a date. This comparison is for anyone building KPI reports or facing an Excel test that asks for a tricky count.

COUNTIFS vs SUMPRODUCT at a glance#

COUNTIFS is the specialist for criteria-based counting; SUMPRODUCT is the flexible all-rounder.

FeatureCOUNTIFSSUMPRODUCT
Typical formula=COUNTIFS(A2:A9,"North",D2:D9,">=3")=SUMPRODUCT((A2:A9="North")*(D2:D9>=3))
AND conditionsYes, built inYes, multiply tests with *
OR conditions in one formulaNo, add two COUNTIFSYes, add tests with +
Wildcards (*, ?)YesNo
Compare two columns row by rowNoYes
Functions on a range (MONTH, LEFT, LEN)NoYes
Case-sensitive testsNoYes, with EXACT
Speed on large dataFastSlower
ReadabilityEasyHarder for beginners
Excel versionsExcel 2007 and laterAll versions

How COUNTIFS counts#

COUNTIFS takes pairs of a range and a criterion, and counts the rows where every pair matches.

Excel formula
=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)

Criteria can be text ("North"), a comparison in quotes (">=3"), a cell (G1), an operator joined to a cell (">="&G2) or a wildcard pattern ("K*"). It is the natural next step after COUNTIF; see COUNTIF vs COUNTIFS. The COUNTIFS function guide lists every criterion type.

How SUMPRODUCT counts#

SUMPRODUCT multiplies arrays together and adds the results. For counting, you give it tests that return TRUE or FALSE for every row.

Excel formula
=SUMPRODUCT((A2:A9="North")*(D2:D9>=3))

Each bracket produces a list of TRUE and FALSE values. Multiplying turns them into 1s and 0s, and a row scores 1 only when both tests are TRUE. SUMPRODUCT then adds the 1s. Multiplying works as AND; adding with + works as OR. For a single test, use a double minus to convert TRUE and FALSE to numbers: =SUMPRODUCT(--(A2:A9="North")). The SUMPRODUCT function guide and the article on SUMPRODUCT explain the logic step by step.

The same counts done both ways#

Here is a sales log with a target for each order:

ABCDE
1RegionRepProductUnitsTarget
2NorthKofiLaptop32
3SouthMeiMonitor54
4NorthRaviMonitor23
5EastKofiLaptop44
6NorthMeiLaptop12
7SouthRaviLaptop22
8EastMeiMonitor65
9NorthKofiMonitor43

Task 1: two AND conditions (North laptops)#

Excel formula
=COUNTIFS(A2:A9,"North",C2:C9,"Laptop")
=SUMPRODUCT((A2:A9="North")*(C2:C9="Laptop"))

Both return 2 (rows 2 and 6). COUNTIFS is shorter and clearer.

Task 2: OR logic (North or South, 3 or more units)#

Excel formula
=COUNTIFS(A2:A9,"North",D2:D9,">=3")+COUNTIFS(A2:A9,"South",D2:D9,">=3")
=SUMPRODUCT(((A2:A9="North")+(A2:A9="South"))*(D2:D9>=3))

Both return 3: rows 2, 9 and 3. COUNTIFS needs one formula per option; SUMPRODUCT puts the OR inside one formula. With two options, either is fine. With five, SUMPRODUCT stays tidier.

Task 3: compare two columns (orders that beat their target)#

Excel formula
=SUMPRODUCT(--(D2:D9>E2:E9))

The result is 4 (rows 2, 3, 8 and 9). COUNTIFS can't do this, because each criterion is a single value, not a different value for every row.

Task 4: wildcards (reps whose name starts with K)#

Excel formula
=COUNTIFS(B2:B9,"K*")
=SUMPRODUCT(--(LEFT(B2:B9,1)="K"))

Both return 3. COUNTIFS supports the * wildcard directly. SUMPRODUCT doesn't, so you test the first letter with LEFT instead.

Task 5: a calculated condition (closed tickets opened in March)#

With dates in B2:B7 and status in C2:C7, as in the exercise on this page:

Excel formula
=SUMPRODUCT((MONTH(B2:B7)=3)*(C2:C7="Closed"))
=COUNTIFS(B2:B7,">="&DATE(2024,3,1),B2:B7,"<="&DATE(2024,3,31),C2:C7,"Closed")

Both return 3. COUNTIFS can't take MONTH(B2:B7) as a range, so it needs a start and end date instead. The SUMPRODUCT version is shorter but counts March in every year, so add *(YEAR(B2:B7)=2024) if the data spans several years.

Task 6: a case-sensitive count#

COUNTIFS ignores upper and lower case, so =COUNTIFS(A2:A9,"north") still returns 4. When case matters, such as product codes where ab-1 and AB-1 are different items, only SUMPRODUCT can help:

Excel formula
=SUMPRODUCT(--EXACT(A2:A9,"North"))

EXACT compares each cell with "North", including case, and returns TRUE or FALSE. The double minus turns those into 1s and 0s, and SUMPRODUCT adds them. On this data the result is still 4, because every entry is typed the same way, but a stray "NORTH" would no longer be counted.

Reading SUMPRODUCT formulas step by step#

If a SUMPRODUCT count looks wrong, test each bracket on its own. Select a blank cell and type =A2:A9="North" in Excel 2021 or Microsoft 365: it spills a column of TRUE and FALSE values, one per row, so you can see exactly which rows pass. Do the same for each test, then multiply them. In older versions, select part of the formula in the formula bar and press F9 to see its result, then press Esc so you don't replace the formula with the values.

When to use COUNTIFS#

Use COUNTIFS as your default for counting with conditions. It fits:

  • AND conditions on several columns, such as region, product and status.
  • Number and date ranges, using ">=" and "<=" criteria.
  • Wildcard matches, such as names that start or end with certain text.
  • Large data sets and dashboards with many formulas, where speed matters.
  • Shared files, where colleagues need to read and edit the formula.

The COUNTIFS and SUMIFS guide shows how the same pattern sums values too.

When to use SUMPRODUCT#

Use SUMPRODUCT when the test goes beyond simple criteria. It fits:

  • OR logic in one formula, especially with several options.
  • Row-by-row comparisons, such as actual vs target or end date vs due date.
  • Tests on calculated values, such as MONTH, YEAR, WEEKDAY, LEFT or LEN of a column.
  • Case-sensitive counts, using --EXACT(A2:A9,"ABC").
  • Weighted totals, such as units × price, where SUMPRODUCT's original job shines. See SUMPRODUCT vs SUMIFS.

In Microsoft 365, =SUM((A2:A9="North")*(C2:C9="Laptop")) works the same way, because dynamic arrays handle the array maths. SUMPRODUCT remains the safer choice for files opened in older versions.

Common mistakes with COUNTIFS and SUMPRODUCT#

  1. Using commas instead of * in SUMPRODUCT tests. =SUMPRODUCT(A2:A9="North",C2:C9="Laptop") returns 0, because TRUE and FALSE values aren't converted. Multiply the tests, or add -- to each.
  2. Ranges of different sizes. Both functions return #VALUE! if one range is A2:A9 and another is C2:C10.
  3. Using wildcards in SUMPRODUCT. (B2:B9="K*") looks for the literal text K*. Use LEFT or SEARCH.
  4. Passing a calculation to COUNTIFS. =COUNTIFS(MONTH(B2:B7),3) is rejected. Use date criteria or SUMPRODUCT.
  5. Double counting with OR. If a row can match both OR conditions, adding tests counts it twice. Wrap the sum in a test: ((test1+test2)>0).
  6. Whole-column references in SUMPRODUCT. A:A makes it process over a million rows and can slow the workbook. Use exact ranges or a table.

Our recommendation#

Reach for COUNTIFS first. It handles most real reporting needs, it is fast on big data, and anyone can read it. Use SUMPRODUCT for the cases COUNTIFS can't handle: OR logic in one formula, comparing columns row by row, and tests on calculated values like the month of a date. In KPI sheets, mixing both is normal; see the KPI summary guide for a worked example.

In short: COUNTIFS for criteria, SUMPRODUCT for logic that criteria can't express.

Practise it#

Try the exercise on this page: count closed tickets opened in March with SUMPRODUCT and MONTH. Then practise COUNTIFS and SUMIFS in a live spreadsheet: you type each formula, and it checks your answer instantly.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

In F2, use SUMPRODUCT to count tickets that were opened in March (month 3, using MONTH on B2:B7) and have the status Closed.

fx
ABCDEFG
1
Ticket
Opened
Status
2
T-01
45355
Closed
March closed
3
T-02
45369
Open
4
T-03
45384
Closed
5
T-04
45376
Closed
6
T-05
45397
Open
7
T-06
45380
Closed
8
9
10

Tip: Build two tests in brackets, MONTH(B2:B7)=3 and C2:C7="Closed", multiply them, and wrap the result in SUMPRODUCT.

Practise this in a lesson

LessonCOUNTIFS and SUMIFSCount and sum with several conditions at once, and learn why SUMIFS puts the sum range first.Function guideCOUNTIFSCount rows that meet several conditions with COUNTIFS. Examples for text, number ranges and between-values, plus a live exercise.Function guideSUMPRODUCTMultiply columns and add the results in one step with SUMPRODUCT. Totals, weighted averages, conditions, and a live exercise to try.

Frequently asked questions

Is SUMPRODUCT better than COUNTIFS?

+

Not in general. COUNTIFS is faster and easier to read for AND conditions. SUMPRODUCT is better only when you need something COUNTIFS can't do, such as OR logic in one formula, row-by-row column comparisons or functions applied to a range.

How do I count with OR conditions in Excel?

+

Add two COUNTIFS together, such as =COUNTIFS(A2:A9,"North")+COUNTIFS(A2:A9,"South"), or use SUMPRODUCT with a plus sign: =SUMPRODUCT((A2:A9="North")+(A2:A9="South")). Both work as long as a row can't match both conditions.

Why does COUNTIFS give an error with MONTH?

+

COUNTIFS needs real cell ranges as its criteria ranges, not calculated arrays like MONTH(B2:B7). Use a date range in COUNTIFS instead, or switch to SUMPRODUCT, which accepts calculated arrays.

What does the double minus (--) mean in SUMPRODUCT?

+

It turns TRUE and FALSE into 1 and 0 so SUMPRODUCT can add them. =SUMPRODUCT(--(A2:A9="North")) counts the North rows. Multiplying two tests together does the same conversion automatically.

Does SUMPRODUCT support wildcards like * and ?

+

No. Wildcards work only in functions with criteria arguments, such as COUNTIFS. In SUMPRODUCT, use LEFT, RIGHT or ISNUMBER(SEARCH()) to test parts of text instead.

Sources

  • COUNTIFS function - Microsoft Support
  • SUMPRODUCT function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. COUNTIFS vs SUMPRODUCT at a glance
  2. How COUNTIFS counts
  3. How SUMPRODUCT counts
  4. The same counts done both ways
  5. When to use COUNTIFS
  6. When to use SUMPRODUCT
  7. Common mistakes with COUNTIFS and SUMPRODUCT
  8. Our recommendation
  9. Practise it

Keep reading

Comparisons· 7 min read

COUNTIF vs COUNTIFS: What's the Difference?

COUNTIF counts cells that meet one condition, such as tickets marked Open. COUNTIFS counts rows that meet several conditions at once, such as Open tickets with High priority, and every condition must be true. COUNTIFS with one pair works exactly like COUNTIF, so many people simply use COUNTIFS for everything.

Conditional math· 7 min read

COUNTIFS and SUMIFS: Multiple Conditions in Excel

COUNTIFS counts rows that meet several conditions, and SUMIFS adds numbers from those rows. Each condition is a pair: a range, then its criteria. A row counts only if it matches every pair. SUMIFS puts the sum range first: =SUMIFS(E2:E9,A2:A9,"North",C2:C9,"Laptop") totals North laptop revenue.

Comparisons· 7 min read

SUMPRODUCT vs SUMIFS: Which Should You Use?

Use SUMIFS for everyday conditional totals, such as sales for one region: it is easier to read, ignores text and is fast on big data. Use SUMPRODUCT when you must multiply columns before adding (units times price), apply a function to the range (such as MONTH), or combine OR conditions in one formula.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free