Use SUMIFS to add up rows that meet every condition
SUMIFS adds the values in a sum range when all of the conditions you give it are true. The syntax is:
=SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
Notice that the sum range comes first. SUMIF puts it last, so the two are easy to mix up.
A two-condition example
Here is a sample list with a region in column A, a product in column B and revenue in column C:
| A (Region) | B (Product) | C (Revenue) |
|---|---|---|
| East | Widgets | 200 |
| East | Gadgets | 150 |
| West | Widgets | 160 |
| East | Widgets | 80 |
| North | Widgets | 240 |
To total the Widgets revenue in the East region:
=SUMIFS(C2:C6, A2:A6, "East", B2:B6, "Widgets")
The result is 280. Only two rows meet both conditions: the East Widgets rows worth 200 and 80.
Each extra pair of criteria adds another test, and a row has to pass all of them to be included.
Use a date range
Test the same column twice to get a window of dates. This total covers the first quarter of 2026, with dates in column A and revenue in column C:
=SUMIFS(C2:C500, A2:A500, ">="&DATE(2026,1,1), A2:A500, "<="&DATE(2026,3,31))
Both date tests check column A, so a row is included only when its date falls between the two.
Use OR logic for either value
SUMIFS applies AND logic. Putting East and West as two criteria for the same column returns 0, because no row is both. To match either value, put the values in an array constant and wrap the formula in SUM:
=SUM(SUMIFS(C2:C6, A2:A6, {"East","West"}))
In the sample table, this returns 590: 430 for East and 160 for West. Two separate SUMIFS added together give the same result and may be easier to read.
Common errors
- #VALUE! appears when the sum range and the criteria ranges are different sizes. Every range needs the same number of rows.
- Wrong argument order. Put the sum range first. Writing the arguments in SUMIF order can give an error or a total you don’t expect.
- Text criteria without quotes return #NAME?, the same as in SUMIF.
- A criterion that matches nothing returns 0, not an error. If a total is 0, check the spelling and spacing of each criterion.
Other places to look
If the rows are hard to describe as a rule, filtering and subtotaling can be easier, and how to sum only visible cells in excel covers that approach. For a single test, how to use sumif in excel is the simpler route. To count rows instead of adding them, countifs with two conditions in excel uses the same structure. When the criteria come from cells that you copy down, lock the references with dollar signs, as explained in how to lock cell reference in excel.