find occurance of something from 2 creterion

L

liu

If I have 2 columns like below:

A,2008
A,2007
C,2007
B,2008
C,2007
A,2008
A,2008
B,2008

I can use COUNTIF(A1:A8,A11) to find the total occurance of A, but how
can I add one moe creterion so I can get the result that it's A and
also 2008 (2nd column). So the answer should be 3 in the example
above.

Thanks for the help,

liu
 
B

Bernard Liengme

In all Excel versions: =SUMPRODUCT(--(A1:A100="A"),--(B1:B100=2008))
Only in Excel 2007 : =SUMPRODUCT(--(A:A="A"),--(B:B=2008))
Only in Excel 2007: =COUNTIFS(A1:A100,"A",B1:B100,2008)
best wishes
 
L

liu

In all Excel versions: =SUMPRODUCT(--(A1:A100="A"),--(B1:B100=2008))
Only in Excel 2007 : =SUMPRODUCT(--(A:A="A"),--(B:B=2008))
Only in Excel 2007: =COUNTIFS(A1:A100,"A",B1:B100,2008)
best wishes

That works. Thank you so much for the hlep.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top