COUNTIFS with ISNUMBER and multiple criteria

こ雲淡風輕ζ 提交于 2021-01-28 11:14:01

问题


I'm trying to count if the following range is "Y" or "S" and contains numbers. I'm trying to exclude cells beginning with "_PVxxxxx_".

I cant use

COUNTIFS($A:$A,">0",$B:$B,"Y") + COUNTIFS($A:$A,">0",$B:$B,"S")

because the formula considers "_PVxxxxx_" to be more than 0 and includes them in the calculation.

Can anybody help? Thanks alot!

Data Example


回答1:


The function SUMPRODUCT is quite versatile, typically more flexible for testing than COUNTIFS and SUMIFS.

It should do the trick (see e.g. https://stackoverflow.com/a/27935006/2707864 or https://stackoverflow.com/a/30854706/2707864) with

=SUMPRODUCT(($A:$A>0)*($B:$B="Y")*(ISNUMBER($A:$A))+...

This works, but I am not sure that you need the part ($A:$A>0)* according to the sample you posted (it doesn't hurt anyway).

PS: If you insist on using COUNTIFS you could use a helper column that uses ISNUMBER and gives, e.g., a suitable numeric result (>0 for numeric data, <0 otherwise). Then you would refer to that column within COUNTIFS.



来源:https://stackoverflow.com/questions/47050958/countifs-with-isnumber-and-multiple-criteria

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!