简体   繁体   English

Excel:如何将sumifs数组公式中的每个项目除以设置值

[英]Excel: How to divide each item in sumifs array formula by set value

I have a spreadsheet which looks like this: 我有一个电子表格,看起来像这样:

A       B           C                 D              E
Status  payed by    involved          # of involved  price
payed   Felix       Felix, Peter            2        22,00 €
open    Timothy     Felix, Peter, Chelsea   3        90,00 €
open    Peter       Peter, Timothy          2        2,40 €
open    Chelsea     Chelsea, Felix          2        7,00 €

Now, I want a formula which calculates how much each person has to pay to come out equal, while only paying for things in which said person was involved in. Currently, I do the following: 现在,我需要一个公式来计算每个人要付出多少才能平等,而只支付该人所参与的事情。目前,我执行以下操作:

=SUMIFS(E2:E13; B2:B13; "*Peter*"; A2:A13; "open")

To calculate how much each person already paid. 计算每个人已经支付了多少。 Then, I want to calculate how much each person has to pay. 然后,我要计算每个人需要支付的费用。 My "dream formula" for that would be: 我的“梦想公式”将是:

{=SUMIFS(E2:E13/D2:D13; A2:A13; "open"; C2:C13; "*Peter*")}

So that each items gets split by the number of people involved and the split part then added to each persons total. 这样,每个项目都将按参与人数进行拆分,然后将拆分部分添加到每个人的总数中。 The problem is, such an array formula does not exist and is not valid. 问题是,这样的数组公式不存在并且无效。

How can I correct that? 我该如何纠正? Thank you!!! 谢谢!!!

Below will sum up the price per involved person where Status is open and involved contains Peter 以下将汇总状态为“公开”且涉案人员包含彼得的每个涉案人员的价格

=SUM(IF(($A$2:$A$5="open") * (ISERROR(FIND("Peter", $C$2:$C$5)) = FALSE), $E$2:$E$5 / $D$2:$D$5, 0))

(It's an array formula so CTRL + SHIFT + ENTER) (这是一个数组公式,因此按CTRL + SHIFT + ENTER)

FYI I referenced SO post here , could be worth a read 仅供参考,我在这里引用了SO帖子,值得一读

尝试使用SUMPRODUCT()

=SUMPRODUCT((E2:E13/D2:D13)*(A2:A13 = "OPEN")*(ISNUMBER(SEARCH("Peter";C2:C13))))

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

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