简体   繁体   中英

Can I use an Excel formula to calculate the sum of some continuous rows?

I have an Excel sheet and it has some data rows looks like:

A    B
---  ---
1    2
2    3
3    1

I don't know the rows of the data range until I open the sheet. I want to know, if it's possible to write a formula to calculate

1X2 + 2X3 + 3X1 + ...(we may have more rows!)

and put the result in a new cell. For now I have to use the formula like

A1*B1 + A2*B2 + A3*B3

If there are more rows in the data range, I have to add more items in my formula, which is not convenience.

This is the intended use of the SUMPRODUCT function. Try:

=SUMPRODUCT(A:A,B:B)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM