如何计算非空白单元格取决于另一个标准/列?

时间:2021-07-01 11:49:36

I need a formula that will count all non blank cells within a range if there is a specific value for another column.

如果另一列有特定值,我需要一个公式来计算范围内的所有非空白单元格。

Column A  Column B   Column C
Anne       Jan 16       AO
Tina       Aug 12       VO
Perry      Mar 31       AO
Gab                     AO
Mallows                 VO

With this, i need to count ALL NON-BLANK cells if:
Column C = "AO" Column C = "VO"

有了这个,我需要计算所有非空白单元格如下:列C =“AO”列C =“VO”

I tried this formula but seems to count all including blank cells.

我试过这个公式,但似乎计算所有包括空白单元格。

=COUNTIFS(C:C, "AO", B:B, "<>COUNTBLANK(B2:B5)")
=COUNTIFS(C:C, "VO", B:B, "<>COUNTBLANK(B2:B5)")

The result should be

结果应该是

If Column C is AO, the result is **2**.
If Column C is VO, the result is **1**.

Can you help me with this? Your prompt response is greatly appreciated.

你能帮我解决这个问题吗?非常感谢您的及时回复。

2 个解决方案

#1


2  

Try these:

=COUNTIFS(C:C, "AO",B:B, "<>")
=COUNTIFS(C:C, "VO",B:B, "<>")

#2


1  

to get 3 in a single shot

一次性获得3分

=SUMPRODUCT(--(C1:C5="AO")+(C1:C5="VO"),--(B1:B5<>""))

#1


2  

Try these:

=COUNTIFS(C:C, "AO",B:B, "<>")
=COUNTIFS(C:C, "VO",B:B, "<>")

#2


1  

to get 3 in a single shot

一次性获得3分

=SUMPRODUCT(--(C1:C5="AO")+(C1:C5="VO"),--(B1:B5<>""))