Log in

View Full Version : COUNTIF (counting two different rows)


mccloudm
Oct 26, 2006, 12:32 PM
Ok I have a countif statement that says...

=COUNTIF(A:A,"A0067")


A0067 is a type of radio we are using. This spreadsheet list what radios are down for repair.

This particular radio belongs to Department A so in Colume B it has "Department A" right beside it.

Now there are some A0067's that belong to Department B. The Countif statement only counts the total amounts of A0067's that are down all together. Is there anyway I can make it Count A0067's for Department A and Department B separate?:confused:

I was thinking I could...

=COUNTIF(A:A,B:B,"A0067";"Department A") but that doesn't work.

Any suggestions?

mccloudm
Oct 26, 2006, 03:45 PM
Maybe I am thinking about this the wrong way. I was thinking,

=IF(A:A="A0067" B:B="A",TRUE,FALSE)

But that gives me a syntax error. And I don't think I can make it coun't how many of the statement is true.

I am at my wits end with this one.

Answer my own queston... again.

This is how I did it.

{=COUNT(IF((A13:A18="A0067")*(J13:J18="A"),P13:P18))}

tada!

WvR
May 18, 2007, 02:24 AM
you could also do the following

=IF(B:B="A",COUNTIF(A:A,"A0067"),0) in another cell do the same for B

or you could reference to either A or B


good luck