View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic[_2_] Domenic[_2_] is offline
external usenet poster
 
Posts: 265
Default Count Unique Values in 1 Column based on Date Range in another Column

Assuming that the dates are true date values (day, month, and year), try
the following, which need to be confirmed with CONTROL+SHIFT+ENTER...

=SUM(IF(FREQUENCY(IF(YEAR(A2:A100)=2008,IF(B2:B100 <"",MATCH("~"&B2:B100,
B2:B100&""))),ROW(B2:B100)-ROW(B2)+1),1))

or

=SUM(IF(FREQUENCY(IF(A2:A100=DATE(2008,1,1),IF(A2 :A100<=DATE(2008,12,31)
,IF(B2:B100<"",MATCH("~"&B2:B100,B2:B100&"",0)))) ,ROW(B2:B100)-ROW(B2)+1
),1))

--
Domenic
http://www.xl-central.com

In article ,
"Brian" wrote:

Howdy All,

I'm use the CountU function to count unique values in a column and it works
great!

Now what I want to do is count the unique values in Column B which occur
between a specific date range in Column A.

Column A contains dates from 2005 through 2009.

Column B contains Order Numbers for each date.

I want to count the unique values in column B for only 2008.

Any Ideas?

Thanks,
Brian