简体   繁体   English

EXCEL公式:将SUMIFS结果乘以来自不同列的相应行值

[英]EXCEL Formula: Multiply SUMIFS outcome with the corresponding row value from a different column

I am trying to use SUMIFS and multiply its output with the a values from the corresponding row. 我正在尝试使用SUMIFS,并将其输出与相应行的a值相乘。 Example: 例:

Example

In This example I will use just 1 criteria for the SUMIFS, but the concept remains the same: SUMIFS(C2:C5; B2:B5; "=Sum"). 在此示例中,我将仅对SUMIFS使用1个条件,但是概念保持不变:SUMIFS(C2:C5; B2:B5;“ = Sum”)。 This would return 5 + 6 = 11 Now I want to multiple that by the corresponding probability. 这将返回5 + 6 = 11现在我想将其乘以相应的概率。 Meaning 5 * 50% + 6 * 20%: SUMIFS(C2:C5; B2:B5; "=Sum") * 含义5 * 50%+ 6 * 20%:SUMIFS(C2:C5; B2:B5;“ = Sum”)*

Any idea how to include the probability in the equation? 任何想法如何将概率包括在方程中?

Thanks! 谢谢!

You can't use SUMIFS for this unless you add a helper column - try using SUMPRODUCT instead 除非添加帮助器列,否则不能使用SUMIFS尝试改用SUMPRODUCT

=SUMPRODUCT((B2:B5="Sum")+0;C2:C5;D2:D5)

SUMPRODUCT multiplies all the arrays/ranges and then sums the result, so we can include your value and probability ranges with a conditional array based on "Sum" in the include range SUMPRODUCT将所有数组/范围相乘,然后将结果求和,因此我们可以将包含您的valueprobability范围的条件数组includeinclude范围内基于"Sum"的条件数组中

With a helper column you can just use column E to multiply C and D , eg this formula in E2 copied down 使用helper列,您可以仅使用E列将CD相乘,例如,将E2此公式向下复制

=C2*D2

and then use SUMIFS like this 然后像这样使用SUMIFS

=SUMIFS(E2:E5;B2:B5;"Sum")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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