Totals with several conditions using SUMIFS and COUNTIFS
Add up or count only the rows that match two or more conditions at once, such as paid invoices in one region or sales above a limit in one month.
FormulasIntermediate10 minExcel · Google Sheets
Example content. The numbers are fictional and made for learning.
Goal
Total the paid invoices in the North region, from a list that mixes regions and statuses.
Why this is useful
Real questions usually have more than one condition: paid and in March, open and over 1,000. SUMIFS and COUNTIFS answer them in one cell, without filtering or sorting the list.
Example
| Row | A | B | C |
|---|---|---|---|
| 1 | Region | Status | Amount |
| 2 | North | Paid | 1,200 |
| 3 | South | Open | 800 |
| 4 | North | Open | 450 |
| 5 | North | Paid | 300 |
| 6 | South | Paid | 950 |
| 7 | North | Open | 600 |
| 8 | Paid in the North | 1,500.00=SUMIFS(C2:C7,A2:A7,"North",B2:B7,"Paid") |
Steps
1. Keep one tidy list
One row per item, with each condition in its own column: region in A, status in B, amount in C. Spell each word the same way every time.
2. Start with the numbers to add
Type =SUMIFS(C2:C7, then the first condition range and its value: A2:A7,"North". In SUMIFS the range to add comes first, unlike SUMIF.
3. Add more conditions
Add each extra condition as another pair: B2:B7,"Paid". Close the bracket. A row is added only when every pair matches.
4. Count instead of add
COUNTIFS uses the same pairs without the range to add: =COUNTIFS(A2:A7,"North",B2:B7,"Open") counts open items in the North.
5. Use cells and comparisons
Point at cells instead of typing words: =SUMIFS(C2:C7,A2:A7,F2,B2:B7,G2). For a limit, put the comparison in quotes and join a cell with &: ">="&H2.
Formulas by language
Cell names such as B2 stay the same. The function name and the character between arguments follow the spreadsheet language. The English line in each list is the reference form used on this site, not a universal spelling. When the decimal sign is a comma, arguments are usually separated with a semicolon, because the comma is already used in numbers.
Paid amounts in the North: 1,200 + 300.
English (United States)
Decimals look like 1.5. Arguments are separated with ,.
=SUMIFS(C2:C7,A2:A7,"North",B2:B7,"Paid")Swedish (Sweden)
Decimals look like 1,5. Arguments are separated with ;.
=SUMMA.OMF(C2:C7;A2:A7;"North";B2:B7;"Paid")German (Germany)
Decimals look like 1,5. Arguments are separated with ;.
=SUMMEWENNS(C2:C7;A2:A7;"North";B2:B7;"Paid")French (France)
Decimals look like 1,5. Arguments are separated with ;.
=SOMME.SI.ENS(C2:C7;A2:A7;"North";B2:B7;"Paid")Spanish (Spain)
Decimals look like 1,5. Arguments are separated with ;.
=SUMAR.SI.CONJUNTO(C2:C7;A2:A7;"North";B2:B7;"Paid")Spanish (Mexico)
Decimals look like 1.5. Arguments are separated with ,.
=SUMAR.SI.CONJUNTO(C2:C7,A2:A7,"North",B2:B7,"Paid")Portuguese (Brazil)
Decimals look like 1,5. Arguments are separated with ;.
=SOMASES(C2:C7;A2:A7;"North";B2:B7;"Paid")Italian (Italy)
Decimals look like 1,5. Arguments are separated with ;.
=SOMMA.PIÙ.SE(C2:C7;A2:A7;"North";B2:B7;"Paid")Dutch (Netherlands)
Decimals look like 1,5. Arguments are separated with ;.
=SOMMEN.ALS(C2:C7;A2:A7;"North";B2:B7;"Paid")
How many North items are still open: 2.
English (United States)
Decimals look like 1.5. Arguments are separated with ,.
=COUNTIFS(A2:A7,"North",B2:B7,"Open")Swedish (Sweden)
Decimals look like 1,5. Arguments are separated with ;.
=ANTAL.OMF(A2:A7;"North";B2:B7;"Open")German (Germany)
Decimals look like 1,5. Arguments are separated with ;.
=ZÄHLENWENNS(A2:A7;"North";B2:B7;"Open")French (France)
Decimals look like 1,5. Arguments are separated with ;.
=NB.SI.ENS(A2:A7;"North";B2:B7;"Open")Spanish (Spain)
Decimals look like 1,5. Arguments are separated with ;.
=CONTAR.SI.CONJUNTO(A2:A7;"North";B2:B7;"Open")Spanish (Mexico)
Decimals look like 1.5. Arguments are separated with ,.
=CONTAR.SI.CONJUNTO(A2:A7,"North",B2:B7,"Open")Portuguese (Brazil)
Decimals look like 1,5. Arguments are separated with ;.
=CONT.SES(A2:A7;"North";B2:B7;"Open")Italian (Italy)
Decimals look like 1,5. Arguments are separated with ;.
=CONTA.PIÙ.SE(A2:A7;"North";B2:B7;"Open")Dutch (Netherlands)
Decimals look like 1,5. Arguments are separated with ;.
=AANTALLEN.ALS(A2:A7;"North";B2:B7;"Open")
Paid amounts of 1,000 or more.
English (United States)
Decimals look like 1.5. Arguments are separated with ,.
=SUMIFS(C2:C7,B2:B7,"Paid",C2:C7,">=1000")Swedish (Sweden)
Decimals look like 1,5. Arguments are separated with ;.
=SUMMA.OMF(C2:C7;B2:B7;"Paid";C2:C7;">=1000")German (Germany)
Decimals look like 1,5. Arguments are separated with ;.
=SUMMEWENNS(C2:C7;B2:B7;"Paid";C2:C7;">=1000")French (France)
Decimals look like 1,5. Arguments are separated with ;.
=SOMME.SI.ENS(C2:C7;B2:B7;"Paid";C2:C7;">=1000")Spanish (Spain)
Decimals look like 1,5. Arguments are separated with ;.
=SUMAR.SI.CONJUNTO(C2:C7;B2:B7;"Paid";C2:C7;">=1000")Spanish (Mexico)
Decimals look like 1.5. Arguments are separated with ,.
=SUMAR.SI.CONJUNTO(C2:C7,B2:B7,"Paid",C2:C7,">=1000")Portuguese (Brazil)
Decimals look like 1,5. Arguments are separated with ;.
=SOMASES(C2:C7;B2:B7;"Paid";C2:C7;">=1000")Italian (Italy)
Decimals look like 1,5. Arguments are separated with ;.
=SOMMA.PIÙ.SE(C2:C7;B2:B7;"Paid";C2:C7;">=1000")Dutch (Netherlands)
Decimals look like 1,5. Arguments are separated with ;.
=SOMMEN.ALS(C2:C7;B2:B7;"Paid";C2:C7;">=1000")
The region and status come from cells F2 and G2, so one formula serves a whole summary table.
English (United States)
Decimals look like 1.5. Arguments are separated with ,.
=SUMIFS(C2:C7,A2:A7,F2,B2:B7,G2)Swedish (Sweden)
Decimals look like 1,5. Arguments are separated with ;.
=SUMMA.OMF(C2:C7;A2:A7;F2;B2:B7;G2)German (Germany)
Decimals look like 1,5. Arguments are separated with ;.
=SUMMEWENNS(C2:C7;A2:A7;F2;B2:B7;G2)French (France)
Decimals look like 1,5. Arguments are separated with ;.
=SOMME.SI.ENS(C2:C7;A2:A7;F2;B2:B7;G2)Spanish (Spain)
Decimals look like 1,5. Arguments are separated with ;.
=SUMAR.SI.CONJUNTO(C2:C7;A2:A7;F2;B2:B7;G2)Spanish (Mexico)
Decimals look like 1.5. Arguments are separated with ,.
=SUMAR.SI.CONJUNTO(C2:C7,A2:A7,F2,B2:B7,G2)Portuguese (Brazil)
Decimals look like 1,5. Arguments are separated with ;.
=SOMASES(C2:C7;A2:A7;F2;B2:B7;G2)Italian (Italy)
Decimals look like 1,5. Arguments are separated with ;.
=SOMMA.PIÙ.SE(C2:C7;A2:A7;F2;B2:B7;G2)Dutch (Netherlands)
Decimals look like 1,5. Arguments are separated with ;.
=SOMMEN.ALS(C2:C7;A2:A7;F2;B2:B7;G2)
The same spoken language can use different separators in different countries. Spanish in Spain often uses a comma for decimals and a semicolon between arguments. Spanish in Mexico often uses a period and a comma. If a formula is rejected, check the spreadsheet locale.
Excel and Google Sheets
- SUMIFS and COUNTIFS work in Excel 2007 and later and in Google Sheets, with the same arguments.
- All conditions must be true at the same time. For either one or the other, add two SUMIFS together.
- Matching ignores upper and lower case: "north" matches North.
- Function names and the separator between arguments follow the spreadsheet language. Excel uses the language of your installation; Google Sheets uses the spreadsheet locale under File, Settings.
- Workbooks from Hellosheetwise store formulas in English. Excel and Google Sheets show them in your language when you open the file.
If something goes wrong
The result is #VALUE!.
The ranges have different sizes, for example C2:C7 and A2:A8. Make every range cover the same rows.
The result is 0 but there are matching rows.
A word does not match exactly. Look for extra spaces or a different spelling, or use drop-down lists for the condition columns.
The limit is ignored.
The comparison must be text in quotes, ">=1000", and a cell is joined with &: ">="&H2.