如何从每行的计算中得到结果的总和?


2

我有以下内容 table1 有多行:

+---------+-------+--------+
| Element | Price | Output |
+---------+-------+--------+

然后我有另一个 table2

+----------+------+
| Quantity | Cost |
+----------+------+

我想要的是什么 Cost 专栏是得到的 ROUNDUP(table2.Quantity/table1.Output)*table1.Price 每行的 table1 然后得到 SUM 每个结果。换一种说法:

ROUNDUP(table2.Quantity1/table1.Output1)*table1.Price1 +
ROUNDUP(table2.Quantity1/table1.Output2)*table1.Price2 +
ROUNDUP(table2.Quantity1/table1.Output3)*table1.Price3 + ...

Answers:


0

这个答案假设table2具有与表1相同的元素并且顺序相同。它不使用Excel表而是使用普通范围。它使用通过Ctrl-Shift-Enter创建的数组公式。考虑以下两个范围:

table1 table2

在一些细胞中,例如K1,产生配方

=ROUNDUP(SUM((F2:F12/C2:C12)*B2:B12),0)

但在该单元格中按Ctrl-Shift-Enter。

公式栏应显示: enter image description here

并且单元格K1应该显示58。

使用Excel表格,公式如下所示: enter image description here

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.