Need a count

S

serve

A B
1 Ford June
2 Ford May
3 BMW June
4 Ford June
5 Ford June
I need to COUNT how many "Fords" have the value of June - the answer should
be 3 in this sample. I tried sumif, countif, sumproduct, maybe I need a
combination?
Thanks.
 
R

renegan

You can use a support column C with this formula:
=IF(AND(A1="Ford",B1="June"),1,0)
Apply this all the rows and get the total of column C.
 
B

bj

sum product should work
= sumproduct(--(A1:A5="Ford"),--(B1:B5="June"))
if there is a chance there are leading or trailing spaces try
= sumproduct(--(trim(A1:A5)="Ford"),--(trim(B1:B5)="June"))
 
A

Ashish Mathur

Hi,

You may also want to try using an array formula although sumproduct is
definitely a better solution

=sum(if(($A$1:$A$5="Ford")*($B$1:$B$5="June"),1,0))

confirmed by a Ctrl+Shift+Enter

Regards,

Ashish Mathur
 
B

Biff

=sum(if(($A$1:$A$5="Ford")*($B$1:$B$5="June"),1,0))
confirmed by a Ctrl+Shift+Enter

No need for the IF function:

=SUM(($A$1:$A$5="Ford")*($B$1:$B$5="June"))

Biff
 

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