简体   繁体   English

具有两个选项的Countifs

[英]Countifs with two options

I am trying to use a countifs to count the places where a store number has either "UE" or "RX" attached to it (in addition to if it matches one other piece of criteria). 我试图用一个COUNTIFS算其中一个店铺数量已经不是“UE” “RX”连接到它(除如果一个其它块的标准匹配)的地方。 So for example the criteria would be something like "A16= criteria & "500UE" or "600RX". 因此,例如,标准将类似于“ A16 = 标准 &“ 500UE”或“ 600RX”。

Here is the formula I have currently: 这是我目前拥有的公式:

=COUNTIFS('AUDIT 1'!$C$3:$C$121,$A16,'AUDIT 1'!$A$3:$A$121,"=*UE")

Now I need to add something to the end of this to the effect of: 现在,我需要在此末尾添加一些内容,以达到以下效果:

,'AUDIT 1'!$A$3:$A$121,"=*RX"

But simply adding that results in no count obviously. 但是,简单地将其相加显然不会产生任何结果。 I understand that, but I'm not sure what revision (or different formula entirely) I should try. 我理解这一点,但是我不确定应该尝试哪种版本(或完全不同的公式)。

Thanks in advance! 提前致谢!

Wrap it ins a SUM() and use an array {} . 将其包装为SUM()并使用数组{}

=SUM(COUNTIFS('AUDIT 1'!$C$3:$C$121,$A16,'AUDIT 1'!$A$3:$A$121,{"*UE","*RX"}))

It basically does two COUNTIFS and sums the two together. 它基本上执行两个COUNTIFS并将两个求和。

I like Scott Craner's answer, but perhaps you might find it simpler to just add a second countif 我喜欢Scott Craner的答案,但也许您会发现添加第二个Countif更为简单

=COUNTIFS('AUDIT 1'!$C$3:$C$121,$A16,'AUDIT 1'!$A$3:$A$121,"=*UE")+COUNTIFS('AUDIT 1'!$C$3:$C$121,$A16,'AUDIT 1'!$A$3:$A$121,"=*RX")

(Edited - originally said Scott's proposal used an array formula, which it does not) (编辑-最初说斯科特的建议使用了数组公式,但没有使用)

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

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