问题
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!

回答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