How to count unique distinct records in a date range
Question: How do i count unique distinct records (B1:B35) in a date range (A1:A35)?
Answer: Here is the formula in D4. See picture below.
=SUM(IF((MATCH(INDIRECT("B"&MATCH(D1,A1:A35)&":B"&MATCH(D2,A1:A35)),INDIRECT("B"&MATCH(D1,A1:A35)&":B"&MATCH(D2,A1:A35)),0))>=(ROW(INDIRECT("B"&MATCH(D1,A1:A35)&":B"&MATCH(D2,A1:A35)))-(MIN(ROW(INDIRECT("B"&MATCH(D1,A1:A35)&":B"&MATCH(D2,A1:A35))))-1))=TRUE,1,0))
Download excel sample file for this tutorial.
count-unique-records-between-a-date-range.xls
(Excel 97-2003 Workbook *.xls)
Functions in this tutorial:
IF(logical_test;[value_if:true];[value_if_false])
Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE
ROW(reference)
returns the row number of a reference
MATCH(lookup_value;lookup_array; [match_type])
Returns the relative position of an item in an array that matches a specified value
INDIRECT(ref_text;[a1])
Returns the reference specified by a text string
SUM(number1,[number2],)
Adds all the numbers in a range of cells
MIN(number1;[number2];
Returns the smallest number in a set of values. Ignores logical values and text.
This blog article is one out of twelve articles on the same subject "count unique and unique distinct".
- Count unique values in a column in excel
- Count unique distinct values in two columns in excel
- Count unique distinct values in three columns combined in excel
- Count unique and unique distinct values in a multicolumn range in excel
- Count unique values and unique distinct values in two ranges combined
- Count unique values and unique distinct values in three ranges combined in excel
- How to count unique combined column values
- How to count unique distinct records in a date range
- Count unique distinct records in a date range and a numeric range in excel
- Count unique distinct values in two columns with date criteria in excel
- Count unique distinct months in excel
- Count duplicate distinct values in a column in excel
- Most common value between two dates in excel
Related posts:
- Count unique distinct records in a date range and a numeric range in excel
- Count unique records by date in excel
- Count date records between two dates in a range in excel
- Count unique and unique distinct values in a multicolumn range in excel
- Count unique distinct values in two columns with date criteria in excel
- Count unique distinct months in excel
- Count unique distinct values using date criteria in a range in excel
- Count unique distinct values in three columns combined in excel
- Count unique distinct values in two columns in excel
- Count unique values and unique distinct values in two ranges combined




September 14th, 2009 at 4:55 pm
This is great!
Is there anyway to do this based on date and another criteria? Say if C had dollar values and you wanted to only find uniques that were between a certain $ value and a certain date?
September 15th, 2009 at 10:16 pm
Ian,
see this blog post: http://www.get-digital-help.com/2009/09/15/count-unique-distinct-records-in-a-date-range-and-a-numeric-range-in-excel/
September 17th, 2009 at 3:03 pm
Thanks so much! I just found the article before checking the comments here. It will really help me out!