ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

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

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Conditional math
  3. COUNTIFS and SUMIFS: Multiple Conditions in Excel

COUNTIFS and SUMIFS: Multiple Conditions in Excel

By ExcelReady Team·Updated October 30, 2026·7 min read

The short answer

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.

Key takeaways

  • COUNTIFS takes range/criteria pairs: =COUNTIFS(range1, criteria1, range2, criteria2, ...).
  • SUMIFS puts the numbers to add first, unlike SUMIF, which puts them last.
  • Every pair is an AND condition. For OR, add two formulas together.
  • All ranges must be the same size, or Excel returns #VALUE!.
  • Mixed references like $G8 and H$7 let one formula fill a whole summary grid.
On this page+
  1. What do COUNTIFS and SUMIFS do?
  2. How to count with multiple conditions using COUNTIFS
  3. How to use Excel SUMIFS with multiple criteria
  4. How to count or sum between two values
  5. How to use OR logic with SUMIFS
  6. How to build a summary grid with one formula
  7. Why is COUNTIFS or SUMIFS returning 0 or an error?
  8. Where you'll use this at work
  9. Practise it

To use Excel SUMIFS with multiple criteria, give it the numbers to add first, then one range/criteria pair for each condition. COUNTIFS works the same way without the sum range: it counts the rows that match every pair. This guide is for anyone building sales, HR or finance summaries, and it covers the syntax, comparisons, OR logic and the one-formula summary grid that often comes up in job tests.

What do COUNTIFS and SUMIFS do?#

COUNTIFS counts rows that meet all of your conditions, and SUMIFS adds a column of numbers for those rows. The syntax:

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

Each condition is a pair: a range to check, then what it must match. You can add up to 127 pairs. Both functions have been in Excel since Excel 2007.

The examples use this order table in A1:E9:

ABCDE
1RegionRepProductUnitsRevenue
2NorthKofiLaptop33600
3SouthLinaMonitor51250
4NorthKofiMonitor2500
5EastRaviLaptop44800
6SouthLinaLaptop11200
7NorthTessLaptop67200
8EastRaviMonitor82000
9SouthOmarLaptop22400

How to count with multiple conditions using COUNTIFS#

Write one pair per condition, separated by commas. To count orders that are North and Laptop:

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

The result is 2 (rows 2 and 7). Pair 1 is the Region column with "North". Pair 2 is the Product column with "Laptop". Row 4 is North but a Monitor, so it doesn't count.

Comparisons work in any pair. To count East orders with 4 or more units:

Excel formula
=COUNTIFS(A2:A9,"East",D2:D9,">=4")

That gives 2 (4 and 8 units). Use >= so an order of exactly 4 counts.

Criteria can also come from cells, so a manager can change the question without editing the formula. If K1 holds East and K2 holds 4:

Excel formula
=COUNTIFS(A2:A9,K1,D2:D9,">="&K2)

This gives the same 2. A plain cell reference needs no quotes. When you add an operator, keep the operator in quotes and join the cell with &; ">=K2" would look for the text K2.

How to use Excel SUMIFS with multiple criteria#

Put the range to add first, then the same pairs you would give COUNTIFS. To total North laptop revenue:

Excel formula
=SUMIFS(E2:E9,A2:A9,"North",C2:C9,"Laptop")

The result is 10,800 (3,600 + 7,200). Here is what each part does:

PartMeaning
E2:E9Add the Revenue column
A2:A9,"North"only where Region is North
C2:C9,"Laptop"and Product is Laptop

Watch the order. In SUMIF the sum range comes last, but in SUMIFS it comes first. Writing =SUMIFS(A2:A9,"North",C2:C9,"Laptop",E2:E9) is a very common SUMIFS mistake. SUMIF vs SUMIFS explains the difference in full.

One more example. Kofi's revenue from orders of 3 or more units:

Excel formula
=SUMIFS(E2:E9,B2:B9,"Kofi",D2:D9,">=3")

Only row 2 matches, so the result is 3,600.

How to count or sum between two values#

Use the same column twice, once with a lower limit and once with an upper limit. To count orders of 2 to 5 units, both included:

Excel formula
=COUNTIFS(D2:D9,">=2",D2:D9,"<=5")

The result is 5 (3, 5, 2, 4 and 2 units). This is also how you total between two dates. See how to sum by date range or month with SUMIFS.

How to use OR logic with SUMIFS#

Every pair in SUMIFS is an AND condition, so for OR you add separate results. To total North or East revenue:

Excel formula
=SUMIFS(E2:E9,A2:A9,"North")+SUMIFS(E2:E9,A2:A9,"East")

That gives 11,300 + 6,800 = 18,100. You can also write =SUM(SUMIFS(E2:E9,A2:A9,{"North","East"})). The curly brackets hold a list, SUMIFS returns one total per item, and SUM adds them.

Don't put both regions on the same column as two pairs. A2:A9,"North",A2:A9,"East" asks for rows that are North and East at once, so it returns 0.

How to build a summary grid with one formula#

A summary grid puts one category down the side and another across the top, with a SUMIFS in every cell. Put North, South and East in G8:G10, and Laptop and Monitor in H7:I7. In H8, type:

Excel formula
=SUMIFS($E$2:$E$9,$A$2:$A$9,$G8,$C$2:$C$9,H$7)

Fill right to I8 (Windows: Ctrl+R; Mac: ⌘R), then fill H8:I10 down (Windows: Ctrl+D; Mac: ⌘D).

The trick is the mixed references. $G8 always reads column G, but its row changes. H$7 always reads row 7, but its column changes. The data ranges are fully locked. You get this grid:

LaptopMonitor
North10,800500
South3,6001,250
East4,8002,000

Check it: the six cells add up to 22,950, the same as =SUM(E2:E9). Swap SUMIFS for COUNTIFS($A$2:$A$9,$G8,$C$2:$C$9,H$7) to build a count grid instead.

Why is COUNTIFS or SUMIFS returning 0 or an error?#

Most problems come from mismatched ranges or criteria that don't match the data exactly:

  1. #VALUE!: the ranges are different sizes, such as E2:E9 with A2:A10. Every range must cover the same rows.
  2. 0 from a wrong order: in SUMIFS the sum range must be first.
  3. 0 from a typo or space: "North " with a trailing space doesn't match "North". Clean the data with TRIM.
  4. Criteria glued to a cell inside quotes: ">=G1" is text. Write ">="&G1.
  5. Numbers stored as text: ">=4" skips units imported as text.

Where you'll use this at work#

Multi-condition totals show up in almost every office role: headcount by department and level, sales by region and product, hours by person and project. They are worth naming on a CV: how to list Excel skills on your resume shows how to describe them, and Excel skills for HR jobs covers the HR versions.

The same pairs also drive AVERAGEIFS for conditional averages and MAXIFS and MINIFS for the highest and lowest values. Partial matches like "starts with CAB-" use wildcards in your criteria. Quick references: the COUNTIFS guide and the SUMIFS guide.

Practise it#

Practise COUNTIFS and SUMIFS in a live spreadsheet with pairs, comparisons and cell-based criteria. Then take the summary-grid skill check, where you fill a region-by-product grid with one formula and prove the totals add up.

Try it yourself

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

Total the revenue for South Laptop orders. Click H2 and use SUMIFS: Revenue (E2:E9) first, then a Region pair (A2:A9) and a Product pair (C2:C9).

fx
ABCDEFGHI
1
Region
Rep
Product
Units
Revenue
2
North
Kofi
Laptop
3
3600
South laptop revenue
3
South
Lina
Monitor
5
1250
4
North
Kofi
Monitor
2
500
5
East
Ravi
Laptop
4
4800
6
South
Lina
Laptop
1
1200
7
North
Tess
Laptop
6
7200
8
East
Ravi
Monitor
8
2000
9
South
Omar
Laptop
2
2400
10
11
12

Tip: The Revenue range goes first. Each word goes right after its own range.

Practise this in a lesson

LessonCOUNTIFS and SUMIFSCount and sum with several conditions at once, and learn why SUMIFS puts the sum range first.LessonPractice and skill check: summary gridsBuild a region by product summary grid with one COUNTIFS or SUMIFS formula, using mixed references like $G8 and H$7, then check your totals.Function guideCOUNTIFSCount rows that meet several conditions with COUNTIFS. Examples for text, number ranges and between-values, plus a live exercise.Function guideSUMIFSTotal values that meet several conditions with SUMIFS. Examples by region, month and number range, common errors, and live practice.

Frequently asked questions

How do I use SUMIFS with multiple criteria?

+

Start with the range to add, then add one range/criteria pair per condition: =SUMIFS(E2:E9,A2:A9,"North",C2:C9,"Laptop"). Only rows that match every pair are added.

Can SUMIFS use OR logic?

+

Not inside one set of pairs, because every pair must match. Add two SUMIFS together, or use a list in curly brackets: =SUM(SUMIFS(E2:E9,A2:A9,{"North","East"})).

Why does SUMIFS return #VALUE!?

+

Usually the ranges are different sizes, such as E2:E9 and A2:A10. Make every range cover the same rows.

Can I use the same column twice in COUNTIFS?

+

Yes. That's how you count a range between two values: =COUNTIFS(D2:D9,">=2",D2:D9,"<=5") counts orders of 2 to 5 units.

Which Excel versions have COUNTIFS and SUMIFS?

+

Both have been in Excel since Excel 2007, so they work in every version you're likely to meet, including Excel for Mac and Excel for the web.

Sources

  • SUMIFS function - Microsoft Support
  • COUNTIFS function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 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. What do COUNTIFS and SUMIFS do?
  2. How to count with multiple conditions using COUNTIFS
  3. How to use Excel SUMIFS with multiple criteria
  4. How to count or sum between two values
  5. How to use OR logic with SUMIFS
  6. How to build a summary grid with one formula
  7. Why is COUNTIFS or SUMIFS returning 0 or an error?
  8. Where you'll use this at work
  9. Practise it

Keep reading

Conditional math· 7 min read

AVERAGEIF and AVERAGEIFS in Excel

AVERAGEIF averages the numbers in rows that meet one condition: =AVERAGEIF(range, criteria, average_range), for example =AVERAGEIF(B2:B9,"Marketing",D2:D9). AVERAGEIFS handles two or more conditions and puts the numbers to average first: =AVERAGEIFS(D2:D9,B2:B9,"Finance",C2:C9,"Senior"). If no row matches, both return the #DIV/0! error, so check your criteria or wrap the formula in IFERROR.

Conditional math· 7 min read

MAXIFS and MINIFS: Highest and Lowest With Conditions

MAXIFS returns the highest number among the rows that meet one or more conditions, and MINIFS returns the lowest. Both put the numbers first, then range/criteria pairs: =MAXIFS(D2:D9,B2:B9,"Marketing") finds the top Marketing salary. They need Excel 2019 or newer. If nothing matches, they return 0, not an error.

Conditional math· 7 min read

Excel Wildcards: *, ? and ~ in COUNTIF and SUMIF

Excel has three wildcard characters for criteria. An asterisk (*) matches any number of characters, so "CAB-*" means starts with CAB-. A question mark (?) matches exactly one character. A tilde (~) before * or ? makes it a normal character. Use them inside quotes in COUNTIF, SUMIF, COUNTIFS and SUMIFS, for example =COUNTIF(A2:A9,"CAB-*").

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free