View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
bpeltzer bpeltzer is offline
external usenet poster
 
Posts: 171
Default count based on 2 criteria (date and status)

=sumproduct(--(f2:f30=date(2007,3,24)),--(f2:f30<=date(2007,3,31)),--(l2:l30="Critical"))
Each of the three arguments of the sumproduct is an array of 1's (true) and
0's (false). Sumproduct first multiplies the three arrays together,
resulting in an array of 1s where all the criteria were met and 0s elsewhere,
then adds the array elements producing a count.

"Rusty" wrote:

I am trying to get the total number of items that match two criteria. The
first criteria is that the date is between 24/03/2007 and including
31/03/2007 (24-31 March 2007) and the second is that the status is Critical.

Date is in column F2 down to F30
Status is in column L2 down to L30

Column F----------Column L
Date Reported-----Status
29/03/2007--------Critical
5/03/2007----------Critical
25/03/2007---------Critical

From the above list I should get a result of 2.

Thanks