SUMIF function
Adds the cells that meet one condition, such as all sales for the East region or every invoice above 500.
Available in All versions of Excel, Excel for the web, Excel for Mac
In every Excel versionWorks in Google Sheets
Syntax
SUMIF(range, criteria, [sum_range])| Argument | What it means | |
|---|---|---|
range | Required | The cells tested against the condition, e.g. the Region column. |
criteria | Required | The condition: a value ("East"), a comparison in quotes (">500"), a wildcard pattern ("Pro*") or a cell reference. |
sum_range | Optional | The cells to add. Leave it out to add the cells of range itself. |
Returns: The total of the values whose row meets the condition, or 0 if none do.
How SUMIF works
SUMIF answers questions like "how much did the East region sell?" or "what is the total of invoices over 1,000?". It scans one column for a condition and adds the matching values from another column (or from the same column). It replaces the manual habit of filtering a list and reading the status bar, and the result updates automatically when the data changes.
The condition is written as text. A plain value means "equal to" and is not case-sensitive ("east" matches East). Comparisons go inside quotes: ">500", "<=100", "<>Cancelled". To compare with a cell, join the operator and the reference: ">"&E1. Wildcards work for text: * means any number of characters and ? exactly one character, so "Pro*" matches every product that starts with Pro. Use ~* to look for a real asterisk.
range and sum_range should be the same size and shape. Excel actually uses the top-left cell of sum_range and stretches it to the size of range, so a shorter sum range does not raise an error but can add the wrong cells. For two or more conditions use SUMIFS, which also has a more logical argument order.
Examples
1Total sales for one region
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Region | Rep | Sales | ||
| 2 | East | Ana | 4200 | 11,950 | |
| 3 | West | Ben | 3150 | ||
| 4 | East | Chloe | 5100 | ||
| 5 | North | Dev | 2800 | ||
| 6 | West | Ema | 3900 | ||
| 7 | East | Femi | 2650 |
Result: 11,950
Rows 2, 4 and 7 have East in column A, so their sales 4,200 + 5,100 + 2,650 are added.
2Invoices above a threshold
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Invoice | Client | Amount | ||
| 2 | INV-101 | Atlas | 320 | 3,900 | |
| 3 | INV-102 | Brio | 1250 | ||
| 4 | INV-103 | Cora | 610 | ||
| 5 | INV-104 | Atlas | 95 | ||
| 6 | INV-105 | Delta | 2040 | ||
| 7 | INV-106 | Brio | 480 |
Result: 3,900
With no sum_range, the tested cells are also the cells added. Only 1,250, 610 and 2,040 are greater than 500.
3Wildcard match on product names
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Product | Units | ||
| 2 | Pro Laptop 14 | 18 | 49 | |
| 3 | Office Chair | 40 | ||
| 4 | Pro Laptop 16 | 9 | ||
| 5 | Desk Lamp | 55 | ||
| 6 | Pro Monitor | 22 |
Result: 49
Pro* matches every name that starts with "Pro": the two laptops and the monitor, 18 + 9 + 22 units.
4Everything from 1 March onwards
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Date | Status | Amount | ||
| 2 | 2026-02-27 | Paid | 900 | 5,310 | |
| 3 | 2026-03-02 | Paid | 1450 | ||
| 4 | 2026-03-09 | Open | 620 | ||
| 5 | 2026-03-17 | Paid | 2100 | ||
| 6 | 2026-03-30 | Open | 380 | ||
| 7 | 2026-04-01 | Paid | 760 |
Result: 5,310
The operator is joined to a real date with &. Every row except 27 February qualifies. Use SUMIFS if you also want an end date or only Paid rows.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
Result is 0 | The criteria text does not match, often because of extra spaces in the data or a number stored as text. | Test one cell with =A2="East"; clean the data with TRIM or convert text numbers. |
Wrong total | sum_range is offset or a different size from range, so other rows are added. | Make both ranges start on the same row and have the same number of rows. |
#VALUE! | A criteria string longer than 255 characters, or a reference to a closed workbook. | Shorten the criteria or open the source workbook. |
Tips
- Put the condition in a cell (
=SUMIF(A2:A7, E1, C2:C7)) so users can change it without touching the formula. - Never write
">E1"— Excel then looks for the literal text E1. Use">"&E1. - Use whole columns (
A:A,C:C) if rows are added often; SUMIF only reads the used area so it stays fast. "<>"adds rows where the tested cell is not empty and""adds rows where it is empty.
Questions
Can SUMIF use two conditions?
No. Use SUMIFS for several AND conditions, or add two SUMIFs together for an OR condition: =SUMIF(A:A,"East",C:C)+SUMIF(A:A,"West",C:C).
Is SUMIF case-sensitive?
No. For a case-sensitive total use =SUMPRODUCT(--EXACT(A2:A7,"East"),C2:C7).
SUMIF or SUMIFS?
SUMIFS does everything SUMIF does and puts the sum range first. Many people use SUMIFS everywhere so they only remember one argument order.
Google Sheets
SUMIF also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
SUMIF in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Danish | SUM.HVIS |
| Dutch | SOM.ALS |
| Finnish | SUMMA.JOS |
| French | SOMME.SI |
| German | SUMMEWENN |
| Hungarian | SZUMHA |
| Italian | SOMMA.SE |
| Norwegian (Bokmål) | SUMMERHVIS |
| Polish | SUMA.JEŻELI |
| Portuguese (Brazil) | SOMASE |
| Portuguese (Portugal) | SOMA.SE |
| Russian | СУММЕСЛИ |
| Spanish | SUMAR.SI |
| Swedish | SUMMA.OM |
| Turkish | ETOPLA |
Recipes that use SUMIF
- How to calculate a running total in Excel
- How to calculate percentage of total in Excel
- How to sum by category in Excel