FxFormula Drills

SUMPRODUCT

SUMPRODUCT multiplies the corresponding cells of its arrays and then adds those products. With one condition written as a TRUE/FALSE array, it behaves like SUMIF. With two multiplied conditions it behaves like SUMIFS. Addition between conditions is OR. Prefer SUMIFS when you are only filtering. Use SUMPRODUCT when the row math and the filter belong in one expression, or when you are in a file that has no SUMIFS.

Syntax

SUMPRODUCT

SUMPRODUCT(array1, [array2], ...)

Arrays must be the same size. SUMPRODUCT multiplies them item by item and sums the products. A condition such as (A2:A5="East") is 1 where it is true and 0 where it is false, so multiplying it by the amount keeps only the matching amounts.

SUMIFS

SUMIFS(sum_range, criteria_range1, criteria1, ...)

Clearer when every test is AND and you do not need extra arithmetic. Easier to read than a product of comparisons.

SUM

SUM(range)

No conditions and no pairwise product. Use it when you already have a column of line totals.

Comparison

QuestionSUMPRODUCTSUMIFSSUM
Pairwise multiply, then addYesNoNo
AND filterMultiply the conditionsExtra pairsNone
OR filterAdd the conditions, then multiply by the amountsAdd two SUMIFS callsNone
Readability for a plain total by regionHarderBetterNo filter
VersionsLong-standing Excel, and Google SheetsExcel 2007 and later, and Google SheetsEverywhere

Worked examples

East total, written as a product

On the four-order sheet, East amounts are 10, 30, and 20. SUMPRODUCT multiplies each amount by 1 or 0 depending on the region. SUMIFS states the same filter without the multiplication.

East 10, West 40, East 30, East 20.
RowABC
1RegionProductAmount
2EastPen10
3WestPen40
4EastBook30
5EastPen20
  • =SUMPRODUCT((A2:A5="East")*(C2:C5)) → 60
  • =SUMIFS(C2:C5,A2:A5,"East") → 60
  • =SUMPRODUCT((A2:A5="East")*(B2:B5="Pen")*(C2:C5)) → 30

The East test is 1, 0, 1, 1 down the rows. Times the amounts 10, 40, 30, 20 that is 10, 0, 30, 20, and the sum is 60. Multiplying a second test, product Pen, also zeroes the East Book, leaving 10 and 20, which sum to 30. SUMIFS is the clearer way to ask for the East total. The product earns its place when more row math has to happen inside the same formula.

Pen or Book, with Lamp excluded

Addition of two tests is OR. A row that is Pen or Book contributes its amount. Lamp must not. This sheet adds a North Lamp of 7 so the OR total is not the same as the grand total.

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

Pen rows and the Book row contribute 10+40+30. Lamp contributes 0 because both tests are false. The sum is 80. SUM of the whole amount column is 87, which still includes the 7. A row that made both tests true would be counted twice. Product names cannot do that. Overlapping numeric tests can.

When to use which

Use SUMIFS for ordinary filters

Region, product, status. Readers recognize SUMIFS faster than a product of comparisons. The East and product-region drills use SUMIFS for that reason.

Use SUMPRODUCT for weighted rows

Price times quantity, already filtered to one region, is a natural SUMPRODUCT: the condition times the price times the quantity. You do not need a helper column of extended prices.

Use SUM when the column is already the thing you want

If each row shows the line total, SUM adds them. SUMPRODUCT is extra machinery on a single column unless you are using it as a filter.

Common mistakes

Text in a numeric array

SUMPRODUCT that multiplies a column containing the header, or a note, can return #VALUE!. Keep the arrays on the data rows only. SUMIFS is more forgiving of text in the sum range because it ignores text.

OR that double-counts

Adding two TRUE/FALSE arrays counts a row twice when both are true. That is correct for mutually exclusive labels and wrong for 'over 10 or East' if a row can be both.

Forgetting the parentheses

The comparisons need parentheses so they become arrays before the multiplication: (A2:A5="East")*(C2:C5). The examples use that form.

Whole-column ranges on a sheet with notes below the table

A2:A5 stops at the data. A:A also sees anything you type under the table. On a short sheet, use the short range.

Versions and compatibility

SUMPRODUCT is in current Excel, in Excel versions older than SUMIFS, and in Google Sheets. The TRUE/FALSE multiplication pattern works in both.

SUMIFS is easier to maintain in Excel 2007 and later and in Google Sheets. You do not give up correctness by preferring it for plain AND filters.

There is no SUMPRODUCT drill in the catalog yet. The SUM and SUMIFS drills cover the same totals with the clearer functions.

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

Is SUMPRODUCT an array formula that needs Ctrl+Shift+Enter?

No. SUMPRODUCT handles the arrays itself. In current Excel you do not press Ctrl+Shift+Enter for the formulas on this page.

Why multiply by the condition instead of using IF?

A condition array of 1s and 0s zeroes the rows you do not want, and SUMPRODUCT adds what remains. IF inside SUMPRODUCT is possible but harder to read. SUMIFS is usually clearer than either.

Can SUMPRODUCT replace COUNTIFS?

Yes. Multiply the conditions and omit the amount, or multiply by 1. The sum of a TRUE/FALSE array is a count. COUNTIFS is still the function to use when you only need a count.

Does Google Sheets support this?

Yes. SUMPRODUCT, SUMIFS, and the comparison arrays work in Google Sheets. Separator style follows the spreadsheet's locale.