FxFormula Drills

SUMIFS with multiple criteria

SUMIFS adds numbers only from rows that meet every condition you list. The sum range is the first argument, followed by pairs of a criteria range and a criterion. That is AND. OR is the sum of two SUMIFS formulas, one for each acceptable value. SUMIF cannot take the second pair, and its arguments are in the other order.

Syntax

SUMIFS

SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

sum_range is added. Each criteria range must be the same size as sum_range. A row is included only when every pair is true for that row. Text criteria and operators go in quotes.

SUMIF

SUMIF(range, criteria, [sum_range])

One condition. The test range comes first and the numbers come last, the opposite of SUMIFS. Use it when you really have only one test.

Comparison

QuestionSUMIFS (AND)Two SUMIFS (OR)SUMIF
LogicEvery condition must be trueEither formula's condition may be trueThe single condition must be true
How you write itMore pairs inside one SUMIFSSUMIFS + SUMIFSOne SUMIF
Sum range positionFirstFirst, in each callLast, and optional
East and PenOne call, two pairsWrong tool if both must be trueCannot express both
Pen or BookA second pair would require both names at once, which is impossibleOne call per product, then addOne call per product, then add

Worked examples

East and Pen

An order counts only when the region is East and the product is Pen. Those rows are 10 and 20. The East Book, 30, fails the product test. The West Pen, 40, fails the region test.

Orders by region and product.
RowABC
1RegionProductAmount
2EastPen10
3WestPen40
4EastBook30
5EastPen20
  • =SUMIF(A2:A5,"East",C2:C5) → 60
  • =SUMIFS(C2:C5,A2:A5,"East",B2:B5,"Pen") → 30

SUMIF with only the region returns 60 because it still includes the Book. SUMIFS puts C2:C5 first, then the region pair, then the product pair. Both pairs have to succeed on the same row, so the result is 30.

Pen or Book, which is not a second pair

Pen or Book means a row may be either product. A second pair inside one SUMIFS would demand a cell equal Pen and equal Book at the same time. Add two SUMIFS calls instead. Lamp is neither product and must stay out, so this sheet includes a North Lamp row of 7.

Pen 10, Pen 40, Book 30, Lamp 7.
RowABC
1RegionProductAmount
2EastPen10
3WestPen40
4EastBook30
5NorthLamp7
  • =SUMIFS(C2:C5,B2:B5,"Pen")+SUMIFS(C2:C5,B2:B5,"Book") → 80
  • =SUMIFS(C2:C5,A2:A5,"East",B2:B5,"Pen") → 10

Pen amounts are 10 and 40. Book is 30. The sum of those two SUMIFS calls is 80. Lamp's 7 is in neither call. The East-and-Pen call on this sheet is only the first row, 10, because the other Pen is West.

When to use which

Use one SUMIFS when every test is required

Region and product, account and month, status and owner. Each extra pair narrows the total. This is the function the East-sales and product-region drills grade.

Add separate SUMIFS calls for alternatives

Pen or Book, East or West, paid or pending. Each acceptable value gets its own SUMIFS, and you add the results. Keep the ranges identical so you are not summing overlapping rows twice. If one row could match both calls, this pattern double-counts it.

Stay with SUMIF for one test

A single region or a single wildcard does not need SUMIFS. Mixing them in one workbook is fine. Do not rewrite a working SUMIF just to make the argument order look modern.

Common mistakes

Putting the criteria range first, as in SUMIF

SUMIFS(A2:A5, "East", C2:C5) is the SUMIF order. SUMIFS will not treat that as a region test. The numbers come first.

Using a second pair to mean OR

Pairs are AND. East plus West as two pairs returns rows that are somehow both regions, which is none of them, so the total is 0.

Double-counting an overlap

SUMIFS for amount greater than 10 plus SUMIFS for region East counts an East row over 10 twice. OR by addition is safe when the groups cannot overlap, such as two product names.

Uneven ranges

Every criteria range has to match the sum range in height and width. A shorter range is a broken formula, not a filter.

Versions and compatibility

SUMIFS is in Excel 2007 and later, including Excel 2016, 2019, 2021, 2024, and Microsoft 365, and in Google Sheets.

SUMIF is older and is also in Google Sheets. The argument-order difference is the same in Google Sheets as in Excel.

SUMPRODUCT can express the same AND and OR tests in very old Excel. Prefer SUMIFS when it is available. It is easier to read.

Practice on Formula Drills

Free drills are open with no account. Premium drills show the problem to everyone and grade the sheet for subscribers.

Free exercises

Premium exercises

Function pages

FAQ

How many conditions can SUMIFS take?

Excel accepts up to 127 range and criterion pairs. A formula that long is hard to audit. If you need more than a handful, a helper column that marks each row TRUE or FALSE is easier to check, and then you SUMIF that column.

Can I use dates as criteria?

Yes. A comparison such as ">="&DATE(2024,1,1) joins the operator to a date. Put the operator in quotes and join the date with &. A bare date without an operator means equal to that date.

Why is my total 0 when I can see the rows?

The usual causes are the SUMIF argument order used by mistake, a criterion that does not match the spelling in the cells, or an extra pair that no row can satisfy. Remove pairs until the total returns, then add them back one at a time.

Does SUMIFS support wildcards?

Yes. "P*" in a product pair works the same way it does in SUMIF. The other pairs still have to be true.