Skip to content

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.

RowABC
1ArgumentWhat it isExample
2sum_rangethe cells to addF2:F40
3criteria_range1, criteria1the first column to check, and its testB2:B40, "Harbor Road"
4criteria_range2, criteria2 and so onmore pairs, up to 127D2: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")
Adds the hours in F2:F40 on the rows where the project is Harbor Road and the status is 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

Start practicing
  1. Not started

    1. North's sales of chairs

    Formula · easy

  2. Not started

    2. Orders in a band

    Formula · medium

  3. Not started

    3. South's sales since a date

    Formula · medium

  4. Not started

    4. Every region for the chosen product

    Formula · hard