Total by several conditions with SUMIFS
Math that comes up at work8 min
Builds on Total by one condition with SUMIF.
A furniture supplier in Ohio needs North's sales of chairs on their own for its monthly report, and finance wants the orders between two amounts. Each of those totals has to pass two tests at once.
How it works
SUMIFS adds the numbers on the rows that pass every test you give it. Each test is a pair: a column to check and what to look for. Picture each pair as a gate the row has to get through. A row that fails any one gate isn't added.
| Row | A | B | C |
|---|---|---|---|
| 1 | Argument | What it is | Example |
| 2 | sum_range | the cells to add | F2:F40 |
| 3 | criteria_range1, criteria1 | the first column to check, and its test | B2:B40, "Harbor Road" |
| 4 | criteria_range2, criteria2 and so on | more pairs, up to 127 | D2:D40, "Billable" |
In SUMIFS the numbers to add come first, the other way around from SUMIF. The tests work as they do in SUMIF: text and comparisons go in quotation marks, and & joins a comparison to a cell. Two pairs on the same column make a band: ">="&H1 and "<="&H2 keep the amounts from H1 to H2.
Example
A builder's timesheet has the project in B2:B40, the status of each entry in D2:D40 and the hours in F2:F40.
=SUMIFS(F2:F40,B2:B40,"Harbor Road",D2:D40,"Billable")Harbor Road hours logged as Internal, and billable hours on other projects, are left out.
Common mistakes
=SUMIFS(B2:B40,D2:D40,"Billable")adds the project names instead of the hours and returns 0. The numbers to add come first in SUMIFS.=SUMIFS(F2:F40,B2:B40,"Harbor Road",D2:D39,"Billable")returns#VALUE!, because one range stops a row early. Every range must cover the same rows.">=100"on its own adds every large order too. For a band, test the same column twice:">=100"and"<=500".- A date typed into the test, such as
">=16/11/2026", depends on the computer's date settings. Put the date in a cell and join it:">="&H1.
In short
=SUMIFS(sum_range, range1, test1, range2, test2), with the numbers to add first.- A row is added only when it passes every test.
- Two tests on the same column make a band, such as from 100 to 500.
- Keep limits and dates in cells and join them to the comparison with
&.
Practice
4 exercises · free with an account