SUMIF包含数组(OR)中的元素之一 [英] SUMIF contains one of elements in array (OR)

查看:245
本文介绍了SUMIF包含数组(OR)中的元素之一的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个付款清单,我想总结一下这个描述等于我的数组元素之一的费用。

  EMTE€120,00 
面包€35,24
Lidl€0,89
加€5,19
阿尔迪€2,29
巨型€4,70

所以使用 {Lidl, Aldi} ,它会给我的总数(2,29 + 0,89)3,18。



我尝试了 Sum.If ,但我似乎没有正确使用语句,并将其与数组类型组合的输入。

解决方案

包含


I have a list of payments where I would like to sum up the costs which description equals to one of the elements in my array.

EMTE     € 120,00 
Bread    € 35,24 
Lidl     € 0,89 
Plus     € 5,19 
Aldi     € 2,29 
Jumbo    € 4,70 

So with an array of {"Lidl", "Aldi"}, It would give me the total of (2,29+0,89) 3,18.

I tried Sum.If, but I don't seem how to use the or statement in it properly and combine it with an array kind of input.

解决方案

Wrap the SUMIF / SUMIFS function in a SUMPRODUCT function to provide an extra level of cyclic calculation.

=SUMPRODUCT(SUMIFS(B:B, A:A, {"Lidl","Aldi"}))

        

这篇关于SUMIF包含数组(OR)中的元素之一的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆