I understand that if I have two rows, let's say A1:G1 that contain prices, and A2:G2 that contain amounts, I can use SUMPRODUCT(A1:G1,A2:G2) to get a total value of all items. This is a very basic textbook example of SUMPRODUCT. I have used it many times in this type of way.
What I don't understand... Suppose I have A1:G1 that contains prices. Then I have A2:G20 that contains rows of orders with amounts. I want to get the total value of all orders. So what I need is a sum of each column, multiplied by each matching price, and then all those results added together. I have to use SUMPRODUCT and I can't create any helper cells. What I tried to do first was:
SUMPRODUCT(A1:G1,{SUM(A2:A20),SUM(B2:B20),SUM(C2:C20),SUM(D2:D20),SUM(E2:E20),SUM(F2:F20),SUM(G2:G20)})
But this generates a formula error. I thought I could define an array that way but I guess not.
I was stuck for a while until I gave up and looked at the answer, which is SUMPRODUCT(A1:G1*A2:G20). I need an explanation why this gives the total value of all orders. I just don't understand why this works. For one thing it only has 1 argument. I don't understand multiplying the two arrays that way (I thought the whole point of SUMPRODUCT was to do the array multiplication with the arrays as separate arguments).
Bookmarks