Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Sum Products Excel: How to Use the SUMPRODUCT Function

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

The SUMPRODUCT function in Excel multiplies corresponding components in given arrays and returns the sum of those products. To use it, enter =SUMPRODUCT(array1, [array2], ...), select the ranges you want to multiply, and press Enter. This is most commonly used to calculate weighted averages or total invoice values without needing to create a separate helper column for every individual multiplication row.

What You'll Need

  • A computer with Microsoft Excel installed (works in all modern versions, including Office 365, Excel 2021, 2019, and 2016).
  • Two or more sets of numerical data organized in columns or rows (arrays) of identical size.
  • A basic understanding of how to select cell ranges in a spreadsheet.

Step-by-Step

  1. Organize Your Data: Ensure your data is laid out in clean columns. For example, if you are calculating total sales, put the "Quantity Sold" in Column A and the "Unit Price" in Column B. It is vital that both columns have the same number of rows; if one range is longer than the other, Excel will return a #VALUE! error.
  2. Select the Target Cell: Click on the empty cell where you want the final total to appear. This is usually at the bottom of your data table or in a dedicated summary area.
  3. Initiate the Formula: Type =SUMPRODUCT( into the cell. Do not press Enter yet, as you need to define the arrays.
  4. Select the First Array: Click and drag your mouse to highlight the first range of numbers (e.g., A2:A10). After selecting the range, type a comma to separate it from the next argument.
  5. Select the Second Array: Click and drag to highlight the second range of numbers (e.g., B2:B10). Ensure this selection is exactly the same size as the first selection.
  6. Close and Execute: Type the closing parenthesis ) and press the Enter key. Excel will now multiply A2*B2, A3*B3, and so on, and then add all those results together into one single number.
  7. Verify the Result: To double-check the math, you can manually create a helper column by multiplying the first two cells (=A2*B2), dragging that formula down, and then using a standard =SUM() function at the bottom. The SUMPRODUCT result should match this total exactly.

Common Mistakes

One of the most frequent errors is mismatched array dimensions. If you select A2:A10 for your first range but B2:B11 for your second, the formula will fail. The arrays must be identical in height and width. If you are working with a table that grows over time, consider using Excel Tables (Ctrl+T) so the ranges update dynamically.

Another common mistake is including text in the numerical ranges. While SUMPRODUCT is designed to treat non-numeric cells as zeros in many cases, having text headers inside your selected range can sometimes lead to unexpected results or errors depending on how the formula is structured. Always start your selection from the first row of actual data, not the header row.

Users also frequently forget that SUMPRODUCT is not just for two arrays. You can include three, four, or more arrays (e.g., =SUMPRODUCT(Qty, Price, Discount_Rate)). The mistake here is usually forgetting the commas between these arrays, which turns the formula into a single-array calculation, leading to an incorrect total.

Tips

Handling Criteria with Booleans: You can use SUMPRODUCT to perform conditional sums similar to SUMIFS. By using a double unary operator (two minus signs), you can force Excel to treat TRUE/FALSE values as 1s and 0s. For example, =SUMPRODUCT(--(A2:A10="Widget"), B2:B10, C2:C10) will only sum the products of B and C where the item in column A is a "Widget".

Using Named Ranges: To make your formulas easier to read, name your ranges. Instead of =SUMPRODUCT(A2:A100, B2:B100), you can name the ranges "Quantity" and "Price" and use =SUMPRODUCT(Quantity, Price). This prevents errors when you are scrolling through large sheets and forget which column is which.

Calculating Weighted Averages: SUMPRODUCT is the fastest way to find a weighted average. Multiply the weights by the values using SUMPRODUCT, then divide the result by the sum of the weights. Example: =SUMPRODUCT(Grades, Weights) / SUM(Weights).

Troubleshooting

If your formula returns a #VALUE! error, the first thing to check is the range size. Click into the formula bar and look at the cell references. If one says A2:A50 and the other says B2:B51, you have found the problem. Adjust the ranges to be identical and press Enter.

If the formula returns 0 when you expect a number, check the formatting of your cells. Often, numbers are stored as text (indicated by a small green triangle in the corner of the cell). SUMPRODUCT ignores text. To fix this, select the column, go to the Data tab, select Text to Columns, and simply click Finish. This converts the "text-numbers" back into actual numeric values.

If the result seems mathematically incorrect, check for hidden rows or filtered data. SUMPRODUCT includes all cells in the specified range, regardless of whether they are hidden by a filter. If you only want to sum visible cells, you will need a more complex combination of the SUBTOTAL or AGGREGATE functions combined with SUMPRODUCT.

Frequently Asked Questions

Can SUMPRODUCT work with data on different worksheets?

Yes. You can reference different sheets by including the sheet name in the array. For example: =SUMPRODUCT(Sheet1!A2:A10, Sheet2!B2:B10). The ranges must still be the same size.

Does SUMPRODUCT replace the need for a pivot table?

For simple totals and weighted averages, yes. However, for complex data analysis, grouping, and reporting, a Pivot Table is still more powerful and flexible than writing multiple SUMPRODUCT formulas.

What is the difference between SUMPRODUCT and SUM?

SUM simply adds up all the numbers in a range. SUMPRODUCT performs a multiplication step for each corresponding pair of cells across multiple ranges before adding the final results together.

Can I use SUMPRODUCT for counting specific items?

Yes. By using the double unary (--) method mentioned in the Tips section, you can use SUMPRODUCT to count how many rows meet multiple specific criteria, acting as a more flexible version of COUNTIFS.

Is SUMPRODUCT slower than other formulas in large sheets?

Because SUMPRODUCT handles arrays, it can be more computationally expensive than a simple SUM. In spreadsheets with tens of thousands of rows and hundreds of SUMPRODUCT formulas, you may notice a slight lag in calculation time.

Can I use SUMPRODUCT with vertical and horizontal arrays?

No. The arrays must be oriented in the same direction. You cannot multiply a vertical column by a horizontal row using the standard SUMPRODUCT syntax; both must be columns or both must be rows.