View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Lars-Åke Aspelin[_2_] Lars-Åke Aspelin[_2_] is offline
external usenet poster
 
Posts: 913
Default count unique records

On Fri, 23 Jan 2009 23:59:00 -0800, kr
wrote:

I have a list of information. I need to count the data per hour, but remove
dups and only count unique recs for the hour.
This is what I have so far.

A B
12:01 8888889
12:05 8888889
12:55 0009988
1:10 1122334
1:15 5559076
1:20 1122334
1:30 5678901
2:00 2345667
3:00 0987654

This is what I have so far to count the # of calls per hour
Column C
12:00 = sumproduct((A2:A10=C2)*(A2:A10<C3) = 3
1:00
2:00

This formula is working great to return the # of values in Column B that
fall between the 2 times. However, I need to remove the duplicates in column
B from that hour to get a raw number - not one number counting more than
once. I've been trying to figure out how to use the COUNTIF but not getting it

Thank you!
Vs2007


Try this formula:

=SUMPRODUCT((A$2:A$10=C3)*(A$2:A$10<C4)*(1/COUNTIF(B$2:B$10,B$2:B$10)))

Note: This formula will only work for duplicates within the same hour.
If there might be duplicates which are not within the same hour, you
need to specify for which hour it should be counted.

Hope this helps / Lars-Åke