Sunday, January 2, 2022

Use sumproduct to sum the product of corresponding values in one or more arrays

SUMPRODUCT uses cell ranges (or Create an array formula) as its arguments (the parts of the formula that make it work). It multiplies together the items in the arrays, and then sums up the result.

This example is a grocery list, with one array listing the cost for each item, and the other array listing how many items will be purchased.

List of grocery items in column A. In column B (Array 1) is the cost per unit. In column C (Array 2) is the Quantity being purchased

  1. To create the formula, type =SUMPRODUCT(B3:B6,C3:C6) and press Enter.

Each cell in column B is multiplied by its corresponding cell in the same row in column C, and the results are added up. The total amount for the groceries is $21.60.

  1. To write a longer formula that gives you the same result, type =B3*C3+B4*C4+B5*C5+B6*C6 and press Enter.

After pressing Enter, the result is the same: $21.60. Cell B3 is multiplied by C3, and its result is added to the result of cell B4 times cell C4 and so on. You can imagine, if you have thousands (or even hundreds) of rows, how much easier using SUMPRODUCT would be.

Notes: 

  • The columns or rows (arrays) must be of equal length.

  • If text, instead of a number, is in a cell, it is treated as zero.

Example

If you want to play around with SUMPRODUCT and Create an array formula, here's an Excel for the web workbook with different data than used in this article.

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

A

B

D

E

3

4

2

7

8

6

6

7

1

9

5

3

Formula

Result

'=SUMPRODUCT(A2:B4,D2:E4)

=SUMPRODUCT(A2:B4,D2:E4)

Multiplies all the components of the two arrays (A2:B4 and D2:E4) and then adds the products — that is, 3*2 + 4*7 + 8*6 + 6*7 + 1*5 + 9*3 (156).

For a fuller experience, you can also open this workbook in Excel. Just click the Excel icon on the lower-right corner of the workbook  Excel icon in Excel Web App, save the file to a convenient place on your computer, and then open it.

Top of Page

1 comment:

  1. Hello guys, I just want to share my joyful experience about HACK VANISH CREDIT SPECIALIST. Before the coronavirus pandemic, I had criminal Judgments, few evictions, and late payment which negatively impacted my credit score down to 487 and left me in difficult financial situation, as a single mum of 3, I needed a loan to keep the family running after I lost my husband as a result of COVID-19, all hope were lost, until Mrs. Olivia referred me to HACK VANISH, a credit genius who was very helpful in fixing my credit 6 days after I reached out to him via Email: hackvanish (At) gmail (Dot) com and Phone: +1(747) 293-8514, throughout the process, I felt so involved because an open line of communication was maintained till I got my FICO score restored to 796, currently my loan application has been approved. If you need to hire a credible hacker, HACK VANISH is highly recommended.

    ReplyDelete