问题
I have the following formula:
=COUNTIFS(A2:A41, {"CORE", "TRIAL"})
However, the count comes as 7 when it should be 10. There are 7 core and 3 trials. Is there something I am missing? Just for testing, I tried putting TRIAL as first and it counted 3
回答1:
Change your formula to
=sum(ArrayFormula(COUNTIF(A2:A41, {"CORE", "TRIAL"})))
or use
=sumproduct(regexmatch(A2:A41, "CORE|TRIAL"))
If you only want exact matches, use
=sumproduct(regexmatch(A2:A41, "^CORE|TRIAL$"))
See if that helps?
来源:https://stackoverflow.com/questions/63276791/google-spreadsheet-countifs-not-respecting-or-condition