Excel functions · Conditional math
SUMIFS function in Excel
SUMIFS adds up the numbers in a range for the rows that meet every condition you give it, such as total sales for the South region or for one rep and one product. It takes the range to sum first, then pairs of criteria ranges and criteria.
Last reviewed
Syntax
=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)- sum_rangerequired
- The cells to add up.
- criteria_range1required
- The cells to test against criteria1. Same size as sum_range.
- criteria1required
- The condition, such as "South", ">=1000" or a cell reference.
- criteria_range2, criteria2, ...optional
- More range and condition pairs, up to 127. A row is added only when it meets all of them.
- Criteria are text: "South", ">=1000", "<>North", or ">"&G1 to compare with a cell. * and ? work as wildcards, and matching ignores case.
- Conditions are combined with AND. For OR, add two SUMIFS together, or use SUMPRODUCT.
- SUMIF (no S) takes one condition and puts sum_range last; SUMIFS puts it first.
Which versions have SUMIFS
Every current Excel version: Microsoft 365, Excel for the web, Excel 2024, 2021, 2019 and 2016, on Windows and Mac.
| Version | Has it |
|---|---|
| Microsoft 365 (Windows and Mac) | Yes |
| Excel for the web | Yes |
| Excel 2024 | Yes |
| Excel 2021 | Yes |
| Excel 2019 | Yes |
| Excel 2016 | Yes |
Google Sheets
Google Sheets has SUMIFS with the same arguments and criteria syntax.
Examples
The examples use this sample sheet.
| Row | A | B | C | D | E |
|---|---|---|---|---|---|
| 1 | Order ID | Rep | Region | Product | Amount |
| 2 | 1001 | Ana | North | Laptop | 1200 |
| 3 | 1002 | Ben | South | Monitor | 300 |
| 4 | 1003 | Ana | North | Monitor | 350 |
| 5 | 1004 | Cara | East | Laptop | 1150 |
| 6 | 1005 | Ben | South | Laptop | 1250 |
| 7 | 1006 | Dev | West | Keyboard | 80 |
| 8 | 1007 | Cara | East | Monitor | 320 |
| 9 | 1008 | Ana | South | Keyboard | 90 |
1.Total for one region
=SUMIFS(E2:E9, C2:C9, "South")Result: 1640
South has orders of 300, 1,250 and 90.
2.Two conditions
=SUMIFS(E2:E9, B2:B9, "Ana", D2:D9, "Laptop")Result: 1200
Only order 1001 is both Ana's and a laptop.
3.Condition on the summed column
=SUMIFS(E2:E9, E2:E9, ">=1000")Result: 3600
The three orders of 1,000 or more: 1,200 + 1,150 + 1,250.
Common errors and fixes
| Error | Why it happens | Fix |
|---|---|---|
| #VALUE! | sum_range and a criteria range are different sizes, such as E2:E9 and C2:C10. | Make every range cover the same rows. |
| 0 when you expect a total | The criteria text doesn't match (extra spaces), or the numbers are stored as text. | Clean the data with TRIM, and convert text numbers with VALUE or Text to Columns. |
Do it with GPTExcel
Skip writing SUMIFS by hand
Upload your Excel or CSV file to Chat and ask in plain English. GPTExcel writes the formula for your file and your version of Excel or Google Sheets.
Total the sales by region and by rep, and flag any rep below 1,000.
Done. I used SUMIFS on your sheet and checked the results against your data.
- Written for your platform and version
- Checked against your actual data
- Newest functions looked up in official docs
SUMIFS questions
- What's the difference between SUMIF and SUMIFS?
- SUMIF handles one condition and its sum range comes last. SUMIFS handles one or more conditions and its sum range comes first. SUMIFS covers everything SUMIF does, so it's a good habit to use it always.
- How do I use SUMIFS with OR?
- SUMIFS joins conditions with AND. For OR, add two SUMIFS: =SUMIFS(E2:E9, C2:C9, "East") + SUMIFS(E2:E9, C2:C9, "West") returns 1,550 on the sample data.
- How do I use a cell value as the condition?
- Put the cell directly for an equal match, like C2:C9, G1. For comparisons, join the operator and the cell with &: ">="&G1.
Skip the formula hunt
Upload a spreadsheet and ask in plain English. Free plan, no credit card.
Start free