When I do:
B C
223 herp
223 herp
3 herp
223 derp
223 herp,derp
=countif(C:C, "*herp*")
I correctly get 4.
When I do
=count(filter(B:B, B:B=223, C:C="*herp*"))
I incorrectly get 0. When I remove the "*" wildcard characters, I get 2, which is better, but doesn't get herp,derp.
Does filter not support wildcard characters? If so, how can I count a row only if two of it's columns meet two different criteria which have wildcards?
FILTER doesn't support wildcards, no. You need to do something like:
=COUNT(FILTER(B:B,B:B=223,SEARCH("herp",C:C)))
or
=COUNT(FILTER(B:B,B:B=223,REGEXMATCH(C:C,"herp")))
Alternatively, in the new version of Sheets, COUNTIFS is supported:
=COUNTIFS(B:B,223,C:C,"*herp*")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With