View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] sbitaxi@gmail.com is offline
external usenet poster
 
Posts: 158
Default Multiple Criteria for CountIF

On Aug 1, 12:41*pm, Rob wrote:
Hello, I was wanting to have a formula that counts all the cells that meet
two sets of criteria but the only way I know of doing this, shown below, does
not work. *Can someone show me how I can do this properly?

=COUNTIF(AND(AA2:AA301="1",D2:D301="YES"))

Thank very much.


First off, you haven't actually defined your criteria in that formula,
you have only identified the range. COUNTIF(Range, Criteria), e.g.
COUNTIF(AA2:AA301,1). SUMPRODUCT is your solution.

=SUMPRODUCT(--(AA$2:A$301=1)*(D$1:D$301="yes"))

That should do it for you.

Steven