0

I have two columns of numbers.
I need to write a formula to multiply the two columns together, and then add all of the products together.

enter image description here

In this case: (16*1) + (6*0) + (4*0) + (4*0) + (4*0) + (2*0) = 16

Normally I would just make a third column to hold the products, and then sum those.
But this table is huge, and I would have to add way too many columns for that approach to be practical.

2

You can do that directly with SUMPRODUCT, which does exactly the calculation in the question:

=SUMPRODUCT(A1:A6,B1:B6)

SUMPRODUCT can also be used with two-dimensional arrays, and more than two columns to be multiplied and then added. See Microsoft Office Support

2

use an array function.

=SUM(A:A*B:B)

and press Ctrl+Shift+Enter to finish your formula. It will end up looking like this:

={SUM(A:A*B:B)}

from:

https://support.office.com/en-us/article/create-an-array-formula-e43e12e0-afc6-4a12-bc7f-48361075954d

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.