[英]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: 我有一个Excel工作表,它有一些数据行,如下所示:
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. 这是
SUMPRODUCT
函数的预期用途。 Try: 尝试:
=SUMPRODUCT(A:A,B:B)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.