简体   繁体   English

SumIF列a = X AND列b = Y或Z

[英]SumIF column a = X AND column b = Y OR Z

我正在努力创建一个公式,该公式求和C列IF(A列= [名称])AND(B列=“可能”或“建议”或“已提交”)。

Use SumProduct with + as the or operator rather than * as the and operator. 将SumProduct与+用作or运算符,而不是*作为and运算符。 Something like this: 像这样:

=SUMPRODUCT(($A:$A=[name])*(($B:$B="Proposed")+($B:$B="Possible")+($B:$B="Committed"))*($C:$C))

您可以尝试以下公式

=SUMPRODUCT((A:A=[name])*(((B:B="Possible")+(B:B="Proposed")+(B:B="Committed"))>0),C:C)

=SUM(SUMIFS($C:$C,$A:$A,[name],$B:$B,{"Proposed","Possible","Committed"}))

With some functions, eg COUNTIF , SUMIF , COUNTIFS , SUMIFS , you can get away with referencing entire columns with no detriment to performance, though not with functions which operate over arrays, such as AGGREGATE , SUMPRODUCT , and any construction requiring CSE . 使用某些函数(例如COUNTIFSUMIFCOUNTIFSSUMIFS ,尽管没有使用在数组上运行的函数(例如AGGREGATESUMPRODUCT以及需要CSE任何构造SUMPRODUCT ,您仍可以引用整个列,而不会影响性能。

Regards 问候

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

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