Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Count the number of unique records

I have this table of data:

refid Date
95528 10/22/2004
95528 10/22/2004
95312 10/22/2004
95312 10/22/2004
95261 10/22/2004
95261 10/22/2004
95051 10/23/2004
95051 10/23/2004
95051 10/23/2004
94999 10/23/2004
94999 10/23/2004
94806 10/24/2004
94806 10/24/2004
94737 10/24/2004
94737 10/24/2004
94678 10/24/2004

I need to do a count only counts a REFID once and only between certian
dates. So, sort of count the number of REFID's that fall on 10/23/2004.
Make sence?

Also, it needs to be done in one formula. Obviously this requires an
array formula. I have a formula that counts the number of entires
between certian dates, but I can't figure out how to count a REFID only
once.

Cheers!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GerryK
 
Posts: n/a
Default Count the number of unique records

If you want to count only once the unique, this comes close but I get a 0.
Maybe someone could help this poor formula out to give 1 as an answer?
Array entered:
=SUM(IF(FREQUENCY(IF((A2:A17=95528)*(B2:B17="10/22/2004"),MATCH(A2:A17,A2:A17,0),""),IF((A2:A17=95528 )*(B2:B17="10/22/2004"),MATCH(A2:A17,A2:A17,0),""))0,1))



" wrote:

I have this table of data:

refid Date
95528 10/22/2004
95528 10/22/2004
95312 10/22/2004
95312 10/22/2004
95261 10/22/2004
95261 10/22/2004
95051 10/23/2004
95051 10/23/2004
95051 10/23/2004
94999 10/23/2004
94999 10/23/2004
94806 10/24/2004
94806 10/24/2004
94737 10/24/2004
94737 10/24/2004
94678 10/24/2004

I need to do a count only counts a REFID once and only between certian
dates. So, sort of count the number of REFID's that fall on 10/23/2004.
Make sence?

Also, it needs to be done in one formula. Obviously this requires an
array formula. I have a formula that counts the number of entires
between certian dates, but I can't figure out how to count a REFID only
once.

Cheers!


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
GerryK
 
Posts: n/a
Default Count the number of unique records

Array entered... this gives 1 as an answer (is this helpful ?)
=SUM(IF(FREQUENCY(IF((A2:A17=D1)*(B2:B17=C1),MATCH (B2:B17,B2:B17,0),""),IF((A2:A17=D1)*(B2:B17=C1),M ATCH(B2:B17,B2:B17,0),""))0,1))
Where C1 is your date and D1 is the redfid number.

"GerryK" wrote:

If you want to count only once the unique, this comes close but I get a 0.
Maybe someone could help this poor formula out to give 1 as an answer?
Array entered:
=SUM(IF(FREQUENCY(IF((A2:A17=95528)*(B2:B17="10/22/2004"),MATCH(A2:A17,A2:A17,0),""),IF((A2:A17=95528 )*(B2:B17="10/22/2004"),MATCH(A2:A17,A2:A17,0),""))0,1))



" wrote:

I have this table of data:

refid Date
95528 10/22/2004
95528 10/22/2004
95312 10/22/2004
95312 10/22/2004
95261 10/22/2004
95261 10/22/2004
95051 10/23/2004
95051 10/23/2004
95051 10/23/2004
94999 10/23/2004
94999 10/23/2004
94806 10/24/2004
94806 10/24/2004
94737 10/24/2004
94737 10/24/2004
94678 10/24/2004

I need to do a count only counts a REFID once and only between certian
dates. So, sort of count the number of REFID's that fall on 10/23/2004.
Make sence?

Also, it needs to be done in one formula. Obviously this requires an
array formula. I have a formula that counts the number of entires
between certian dates, but I can't figure out how to count a REFID only
once.

Cheers!


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Count the number of unique records

Looks like its gettting close. I'll have to work on that formula a bit.
Thanks for the reccomendation.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Count the number of unique records

This one is VERY cpu intensive.

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default Count the number of unique records

Wait, I lied.
=SUMPRODUCT(--(MONTH($D$3:$D$10000)=$F5),($C$3:$C$10000<"")/COUNTIF($C$3:$C$10000,$C$3:$C$10000&""))
(this is entered as an array formula)
Also, where $F5 is the month number in question (IE 12 for December)

This works, its just VERY cpu intensive.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Aladin Akyurek
 
Posts: n/a
Default Count the number of unique records

You can probably obtain a better performance score with:

=COUNTDIFF(IF($D$3:$D$10000-DAY($D$3:$D$10000)+1=$F5,$C$3:$C$10000,""),FALSE," ")

which must be confirmed with control+shift+enter, not just with enter.

Note 1. You need to download and install the morefunc.xll add-in.

Note 2. F5 must house the first day date of a month/year of interest.
For example: 1-Oct-2004. Take notice of 1 as day number.

Note 3. If C:D is sorted in ascending order on column D, we can do even
better qua performance.

wrote:
Wait, I lied.
=SUMPRODUCT(--(MONTH($D$3:$D$10000)=$F5),($C$3:$C$10000<"")/COUNTIF($C$3:$C$10000,$C$3:$C$10000&""))
(this is entered as an array formula)
Also, where $F5 is the month number in question (IE 12 for December)

This works, its just VERY cpu intensive.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting unique records based on date range aspAddict Excel Worksheet Functions 3 October 26th 05 09:12 PM
How do I show number of records that meet criteria filter CliffD Excel Discussion (Misc queries) 3 August 22nd 05 02:10 PM
Top 90% of records - Bring out number [email protected] Excel Discussion (Misc queries) 4 August 22nd 05 12:45 PM
Count number of unique items in a column that contains duplicates Steembeem Excel Worksheet Functions 3 February 2nd 05 01:51 AM
Count number to reach a cumulative value Bruce Excel Worksheet Functions 5 January 25th 05 06:14 PM


All times are GMT +1. The time now is 05:13 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"