Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiply the value in two columns and then sum the result of all rows?

Tags:

function

excel

Here's what I am trying to achieve:

A  | B
10 | 2
10 | 1

10*2 = 20
10*1 = 10

20 + 10 = 30.

The row range could be anything... from 2 to 50 rows for example. I thought I could accomplish this with one function but I can fingure out how to combine both into one:

=(A1*B1) + (A2*B2) + ...

The way above works, but I want it to be able to add more rows automatically without having to write them individually, by using a range.

Something like:

=SUM((C3*D3):(C14*D14))

I'd appreciate any help.


1 Answers

If I'm understanding you correctly, what you want is the sumproduct function?

=SUMPRODUCT(A1:A2, B1:B2)
like image 160
chrisb Avatar answered Sep 13 '25 11:09

chrisb