## How to count unique values between two dates in Excel?

Have you ever confused with counting unique values between a date range in Excel? For instance, here are two columns, column ID includes some duplicates numbers, and column Date includes date series, and now I want to count the unique values between 8/2/2016 and 8/5/2016, how can you quickly solve it in Excel?
Count unique values within date range by formula
Count unique values within date range by Kutools for Excel

#### Count unique values within date range by formula

To count unique values within a date range, you can apply a formula.

Select a cell that you will place the counted result, and type this formula =SUMPRODUCT(IF((B2:B8<=E2)*(B2:B8>=E1), 1/COUNTIFS(B2:B8, "<="&E2, B2:B8, ">="&E1, A2:A8, A2:A8), 0)), press Shift + Ctrl + Enter to get the correct result. See screenshot:

Tip: in the above formula, B2:B8 is the date cells in your data range, E1 is the start date, E2 is the end date, A2:A8 is the id cells you want to count unique values from. You can change these criteria as you need.

#### Count unique values within date range by Kutools for Excel

To count the unique values between two given dates, you also can apply Kutools for Excel’s Select Specific Cells utility to select all values between the two dates, and then apply its Select Duplicate & Unique Cells utility to count and find the unique values.

 with more than 300 handy functions, makes your jobs more easier. Free Downloadfree full-featured in 30 days

After Kutools for Excel, please do as below:

1. Select the date cells and click Kutools > Select > Select Specific Cells. See screenshot:

2. In the Select Specific Cells dialog, check Entire row option in Selection type section, select Greater than or equal to and Less than or equal to from the two drop down lists separately, check And between two drop down lists, and enter start date and end date separately in the two textboxes in Specific type section. See screenshot:

3. Click Ok, and a dialog pops out to remind you the number of selected rows, click OK to close it. Then press Ctrl + C and Ctrl + V to copy and paste the selected rows in another location. See screenshot:

4. Select the id numbers from the pasted range, click Kutools > Select > Select Duplicate & Unique Cells. See screenshot:

5. In the popping dialog, check All unique (Including 1st duplicates) option, and check Fill backcolor or Fill font color if you want to highlight the unique values, and click Ok. And now another dialog pops out to remind you the number of unique values, and at the same time the unique values are selected and highlighted. See screenshot:

### Best Office Productivity Tools

#### Supercharge Your Spreadsheets：Experience Efficiency Like Never Before with Kutools for Excel

 Popular Features: Find/Highlight/Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ... Super Lookup: Multiple Criteria VLookup  |   Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup .... Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List .... Column Manager: Add a Specific Number of Columns   |   Move Columns   |   Unhide Columns   |   Compare Columns to Select Same & Different Cells ... Featured Features: Grid Focus   |  Design View   |   Big Formula Bar   |  Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells   |  Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ... Top 15 Toolset:  12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   Many More...

Kutools for Excel boasts over 300 features, ensuring that what you need is just a click away...

Supports Office/Excel 2007-2021 & newer, including 365   |   Available in 44 languages   |   Enjoy a full-featured 30-day free trial.

#### Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

• Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
• Open and create multiple documents in new tabs of the same window, rather than in new windows.
• Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
{="TOTAL ORANGES: "&SUM(IF(FREQUENCY(IF(\$B\$4:\$B\$59<>"",MATCH(\$B\$4:\$B\$59,\$B\$4:\$B\$59,0)),ROW(\$B\$4:\$B\$59)-ROW(B4)+1),\$K\$4:\$K\$59))}

1. This only counts an incident once
2. Sums the value associated with each incident
3. Needs to sum only values between two dates.
This comment was minimized by the moderator on the site
Hi there! This worked perfectly for what I needed but I need to alter it so that it does not county blank cells - do you have any recommendations for this?
This comment was minimized by the moderator on the site
Do you know what formula apply to count non repeated values within a date range? In the example above it is 2. Thanks!
This comment was minimized by the moderator on the site
Hi this formula works for me but i would like to add another criteria & say only find the uniques if

=SUMPRODUCT(IF((Table2[DATE]<=J2)*(Table2[DATE]>=I2),1/COUNTIFS(Table2[DATE],"<="&J2,Table2[DATE],">="&I2,Table2[ORDER],Table2[ORDER]),0))
This comment was minimized by the moderator on the site

i need special formulas, i will explain what i want, i have sheet contain two columns (Date & Item) i received different items in one day and its repeated randomly, ex-

1-Dec-2017 TV
1-Dec-2017 TV
1-Dec-2017 TV
1-Dec-2017 Oven
2/3/4-Dec-2017 .....etc

in each day i want to count how many TV/Radio/Oven..etc in each day only.
This comment was minimized by the moderator on the site
I think the pivottable can do you a favor.
This comment was minimized by the moderator on the site
This formula doesn't
work for me just keeps giving me "0"
This comment was minimized by the moderator on the site
Sorry that is not work for you, but the formula works perfect in my way. Could you upload screenshot of your file or descibe much more details about your problem? Maybe we can find the reason. Thank u.
This comment was minimized by the moderator on the site
Did you get to the bottom of this one? Mine is showing '0' too.
This comment was minimized by the moderator on the site
Do you hold Shift + Ctrl and press Enter key? Or is there any unique values in your date range?This formula used to count unique values in a date range only.
This comment was minimized by the moderator on the site
Thanks for the great article. I tried using the below formula, but keep getting this error: "Function DIVIDE parameter 2 cannot be zero." [quote]=ArrayFormula(SUMPRODUCT(IF((D4:D200=M3), 1/COUNTIFS(D4:D200, "="&M3, C4:C200, C4:C200), 0)))[/quote] D4:D200 - date span C4:C200 - data span M3 - the date (1st day of the month)
There are no comments posted here yet