简体   繁体   English

加总2套多个条件

[英]Sumifs 2 sets of multiple criteria

I had made some researches here before posting. 发布之前,我在这里做了一些研究。 I might missed something so please be nice. 我可能会错过一些东西,所以请保持友善。

Anyway, I am trying to derive the sum by having 2 sets of multiple conditions into 2 criterias. 无论如何,我试图通过将2组多个条件转换为2个条件来得出总和。

For example, 例如,

I need the sum of dogs, fish and cats by owners Alpha and Beta. 我需要所有者Alpha和Beta的狗,鱼和猫的总和。

My formula is 我的公式是

=Sum(Sumifs(Numberofpets,pet,{"dog","fish","cat"},Owner,{"Alpha","Beta"}))

Only the Dog has a sum. 只有狗有一笔钱。 Is it possible to have 2 sets of array in sumifs? sumifs中是否可以有2组数组?

The best alternative that I have is below. 下面是我最好的选择。

=Sum(Sumifs(Numberofpets,pet,{"dog","fish","cat"},Owner,"Alpha")+Sumifs(Numberofpets,pet,{"dog","fish","cat"},Owner,"Beta"))

The arrays for the owners might expand in the future. 所有者的阵列将来可能会扩展。

Thanks a lot! 非常感谢!

在这种情况下,我将使用带有值数组的命名范围作为查找条件。

=sumproduct(sumifs(Numberofpets,pets,choose({1,2},dogrange,ownerrange)))

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

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