View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default COUNT IF in array

Try this:

=SUMPRODUCT(--(A1:A5=22),--(B1:B5="cat"))

Better to use cells to hold the criteria:

D1 = 22
E1 = cat

=SUMPRODUCT(--(A1:A5=D1),--(B1:B5=E1))


--
Biff
Microsoft Excel MVP


"WildWill" wrote in message
...
Hi

I have the following data:

A B
22 Cat
29 Bat
22 Tax
24 Bat
22 Cat

I want to calculate the total number (COUNT) of the occurences of "Cat" in
Column B, where Column A's value is "22". I.e. the answer to the above
example will be 2.