Aug 31 2017
09:06 AM
- last edited on
Jul 25 2018
09:59 AM
by
TechCommunityAP
Aug 31 2017
09:06 AM
- last edited on
Jul 25 2018
09:59 AM
by
TechCommunityAP
COUNTIFS(A1:A2,"=6",A1:A2,"=1") does not return the same as COUNTIFS(A1:A2,"=6") + COUNTIFS(A1:A2,"=1")
A1 is 1
A2 is 6
COUNTIFS(A1:A2,"=6",A1:A2,"=1") returns 0
COUNTIFS(A1:A2,"=6") + COUNTIFS(A1:A2,"=1") returns 2
What is going on?
Thank you
Aug 31 2017 09:52 AM
Dawn,
it should be clear that the value of a cell can't be 1 and 6 at the same time.
Your are probably looking for this:
=SUM(COUNTIFS(A1:A2,{1,6}))
Aug 31 2017 10:39 AM
Aug 31 2017 11:27 AM - edited Aug 31 2017 11:28 AM
Dawn,
you are not understanding how COUNTIFS() works.
COUNTIFS(A1:A2,"=6",A1:A2,"=1") counts every occurance where A1=6 AND A1=1 plus where A2=6 AND A2=1.
As I pointed out before the value of a cell can't be 6 and 1 at the same time. Thus the result for A1 is 0 and the result for A2 is 0. Added together: 0.
My formula SUM(COUNTIFS(A1:A2,{1,6})) is just a shortend form of your COUNTIFS(A1:A2,6) + COUNTIFS(A1:A2,1).
It is definitely not a bug.
Aug 31 2017 11:43 AM
Perfect. That helped me get it. Thank you. I was not understanding how the COUNTIFS function worked.. I appreciate your time replying and prompt response.
Aug 31 2017 08:21 PM
By the way, if you compare with a number, you don't need to wrap the number in quotes.
=COUNTIFS(A1:A2,6)+COUNTIFS(A1:A2,1)