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!
The function SUMPRODUCT
is quite versatile, typically more flexible for testing than COUNTIFS
and SUMIFS
.
It should do the trick (see eg 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, eg, a suitable numeric result (>0 for numeric data, <0 otherwise). Then you would refer to that column within COUNTIFS
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.