Learn

Platform

For Business

Pricing

Resources

data analytics lesson video

data analytics lesson video

data analytics lesson video

SUMPRODUCT in Excel: Quick Tutorial and Filtered Examples

SUMPRODUCT in Excel: Quick Tutorial and Filtered Examples

SUMPRODUCT in Excel: Quick Tutorial and Filtered Examples

In this short guide you will learn what the SUMPRODUCT function does, how to use it for simple totals and filtered calculations, and why it can replace longer manual steps. This is useful for analysts who want compact formulas for weighted sums or conditional multiplications. No advanced array skills required.

Interested in learning more? Continue learning with

Interested in learning more? Continue learning with

Excel Formulas & Functions

Excel Formulas & Functions

What You'll Learn / Key Take-Aways

- SUMPRODUCT multiplies corresponding elements from one or more arrays and returns the sum of those products.

- Use a basic form for row-by-row multiplication and summing, e.g. total revenue = SUMPRODUCT(quantities, prices).

- Add filters by turning conditions into logical arrays and multiply them into the calculation to include only matching rows.

- Arrays must share the same dimensions. Nonnumeric or mismatched ranges cause errors or unexpected zeros.

- Behind the scenes Excel converts logical tests to zeros and ones, so multiplication acts like an AND filter.

## What SUMPRODUCT actually does

SUMPRODUCT sounds complicated, but the idea is simple. Given two or more arrays that line up row by row, SUMPRODUCT multiplies the corresponding cells and then adds those products together.

Think of it as doing these steps in one formula instead of calculating a product in each row and then summing the column manually.

Example in plain math:

- Row 1: quantity 2 times price 0.50 gives 1.00

- Row 2: quantity 4 times price 1.00 gives 4.00

- Row 3: quantity 3 times price 0.80 gives 2.40

- SUMPRODUCT returns 1.00 + 4.00 + 2.40 = 7.40

In Excel you would write that as:

=SUMPRODUCT(B2:B4, C2:C4)

Which produces the same 7.40 in one step.

## Syntax and basic rules

- Basic syntax: =SUMPRODUCT(array1, [array2], ...)

- All arrays must have the same dimensions. If one range is longer or shorter Excel will return an error.

- Arrays are typically contiguous ranges like B2:B100 or entire columns when appropriate.

- SUMPRODUCT only sums the products. It will not automatically ignore text. Nonnumeric entries are treated as zeros in the multiplication.

## Adding filters: how to compute conditional sums

Often you only want the product for rows that meet one or more conditions. To add filters, replace a plain range argument with a logical expression that returns TRUE or FALSE for each row.

Example: only include rows where the Store column equals Shaws.

=SUMPRODUCT((A2:A17="Shaws") * (B2:B17) * (C2:C17))

A few important points about this formula:

- (A2:A17="Shaws") creates a logical array that looks like TRUE, FALSE, TRUE, ... for each row.

- Excel converts those TRUEs and FALSEs to 1s and 0s behind the scenes when used in a mathematical operation.

- Multiplying the logical array by the numeric arrays effectively keeps rows where the logical value is TRUE and zeros out rows where it is FALSE.

- You can stack filters. For example, to select rows where Store is Shaws and Product is Apple:

=SUMPRODUCT((A2:A17="Shaws") * (B2:B17="Apple") * (C2:C17) * (D2:D17))

Each filter multiplies another logical array. Only rows where every logical array is 1 will contribute a nonzero product.

Note on separators: when you use no logical tests and only supply ranges to be multiplied, you can separate arrays with commas. When you include logical expressions and want to combine them with multiplication, you will typically use the multiplication operator between those expressions. Using multiplication makes the intent explicit and performs the AND behavior you expect.

## Why this works: the zeros and ones trick

Behind the scenes any logical test like A2:A17="Shaws" becomes an array of zeros and ones. Those zeros and ones multiply with other arrays. If one filter returns 0 in a row, the whole row multiplies to zero and is effectively excluded from the sum.

So multiplication of logical arrays acts like a logical AND. If you need an OR, you can add the logical arrays instead of multiplying, or use other approaches, but addition changes the math and needs careful handling to avoid double counting.

## Practical examples and alternatives

- Weighted average or weighted sum: SUMPRODUCT is ideal. For weights in column W and values in column V:

=SUMPRODUCT(V2:V100, W2:W100) / SUM(W2:W100)

- Replace manual helper columns. Instead of creating a product column and then SUMing, SUMPRODUCT does it in one formula.

- When you need complex criteria, SUMPRODUCT can often do what SUMIFS cannot, for example when you need to multiply multiple columns together for only certain rows.

## Common pitfalls and gotchas

- Range sizes must match. If one range is B2:B10 and another is C2:C9, Excel will throw an error. Always check you have the same number of rows in each array.

- Nonnumeric values become zeros. If a numeric column contains text, that row will contribute zero to the total.

- Be careful with whole-column references in older Excel versions. SUMPRODUCT will try to process every cell in a full column which can be slow. Prefer explicit ranges like B2:B1000.

- If you want OR logic between filters, simple multiplication will not work. You may need addition logic or helper formulas.

## Additional Tips, Pitfalls to Avoid & Pro Advice

- Use SUMPRODUCT instead of helper columns when you want concise sheets and fewer intermediate columns. It keeps the model cleaner.

- For readability, use named ranges where possible. =SUMPRODUCT(Quantities, Prices) reads better than long range references.

- If performance becomes an issue, limit ranges to the actual data set rather than entire columns.

- Check for trailing spaces or inconsistent capitalization when matching text. Consider wrapping filter comparisons in TRIM or UPPER if needed: (TRIM(UPPER(A2:A17))="SHAWS")

## FAQ

Q: What does SUMPRODUCT do in Excel?

A: SUMPRODUCT multiplies corresponding items from two or more ranges and returns the sum of those products. It is useful for weighted sums and conditional multiplications.

Q: How do I add criteria to SUMPRODUCT?

A: Turn a comparison into a logical array, then multiply it into the formula. For example: =SUMPRODUCT((A2:A17="Shaws")*(C2:C17)*(D2:D17)).

Q: Why is my SUMPRODUCT returning zero?

A: Common reasons: your filters evaluate to FALSE for every row, you have nonnumeric values in the numeric arrays, or your ranges do not align in size.

Q: Can SUMPRODUCT replace SUMIFS?

A: For many conditional sums yes, especially when you need multiplication or more complex logic. SUMIFS is simpler for basic conditional sums and is faster on large ranges.

Q: Do all ranges in SUMPRODUCT need the same length?

A: Yes. All arrays must have identical dimensions or Excel will produce an error.

Q: How do logical arrays work inside SUMPRODUCT?

A: Logical tests like A2:A17="Shaws" are converted to 1s and 0s. Multiplying these into numeric arrays includes only rows where the test is true.

## Summary of Key Points / Take-Home Messages

- SUMPRODUCT multiplies row elements across arrays and sums the results in one formula.

- Use logical arrays multiplied into the formula to filter rows. Multiplication acts like an AND.

- Always ensure array dimensions match and prefer explicit ranges for performance.

- SUMPRODUCT is a compact, flexible tool for weighted sums and conditional calculations.

FOR INDIVIDUALS

Master modern data skills

Start learning for Free. No credit card required. Master skills in data literacy, Excel, Power BI, SQL, Python and more.

FOR COMPANIES & TEAMS

Train your team in data

Create your team account today, request a demo, or start with a team assessment today.

FOR INDIVIDUALS

Master modern data skills

Start learning for Free. No credit card required. Master skills in data literacy, Excel, Power BI, SQL, Python and more.

FOR COMPANIES & TEAMS

Train your team in data

Create your team account today, request a demo, or start with a team assessment today.

FOR INDIVIDUALS

Master modern data skills

Start learning for Free. No credit card required. Master skills in data literacy, Excel, Power BI, SQL, Python and more.

FOR COMPANIES & TEAMS

Train your team in data

Create your team account today, request a demo, or start with a team assessment today.