View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jenny.S[_2_] Jenny.S[_2_] is offline
external usenet poster
 
Posts: 4
Default Counting data that meets 3 different Criteria

Thanks, please see my reply to Dave. Can you help?

Thanks,
Jenny

"Liliana" wrote:


Sumproduct can do this. Backgound reading

http://www.contextures.com/xlFunctio...tml#SumProduct

http://en.allexperts.com/q/Excel-105...-functions.htm


Example

Count the number of matches in the range A1:C12 that match the criterea in
cells A16-C15



=SUMPRODUCT(--(MONTH($B$1:$B$12)=MONTH(B15))*($C$1:$C$12=C15)*($ D$1:$D$12
=D15))


The above assumes:

- B15 contains a full date (i.e not "June" or "6" but for example
"6/6/2009") and $B$1:$B$12 contains dates
- C16 and D16 contain values that match data from the above columns and
require no conversion.



You many find it easier to handle you date matching if you use a helper
column to convert your date to month:

=TEXT(B1,"mmm")
Where B1 is a date

The result becomes Jun

For example, if you converted in column E, your formula then becomes

=SUMPRODUCT(($C$1:$C$12=C15)*($D$1:$D$12=D15)*($E$ 1:$ED$12=E15))

--
Lil



?B?SmVubnkuUw==?= wrote in
:

Hi,

Would love some help with this challenge.

Accident data is being recoded in a spreadsheet and has info recorded
for 12 month. In a separate tab I want to count the number of
instances by a given month, then by a given department, and then by
accident type. Have used three separate "countif" statements and can
get the number of accidents for a month, the total number for a give
department for 12 months, and the total number by accident type for 12
months. I want to be able to get the total for a month, by
department, then accident type.

Hope someone can help me, thanks.




--