Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to count unique values between two dates in Excel?

doc count uniques between dates 1
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

arrow blue right bubble 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:
doc count uniques between dates 2

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.


arrow blue right bubble 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.

Kutools for Excel, with more than 120 handy Excel functions, enhance your working efficiency and save your working time.

After free installing Kutools for Excel, please do as below:

1. Select the date cells and click Kutools > Select > Select Specific Cells. See screenshot:
doc count uniques between dates 3

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:
doc count uniques between dates 4

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:
doc count uniques between dates 5 doc count uniques between dates 6

4. Select the id numbers from the pasted range, click Kutools > Select > Select Duplicate & Unique Cells. See screenshot:
doc count uniques between dates 7

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:
doc count uniques between dates 8

doc download 1


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    David · 3 months ago
    Hi this formula works for me but i would like to add another criteria & say only find the uniques if

    Table2[TASK]="PSHP" or "SHIP"



    =SUMPRODUCT(IF((Table2[DATE]<=J2)*(Table2[DATE]>=I2),1/COUNTIFS(Table2[DATE],"<="&J2,Table2[DATE],">="&I2,Table2[ORDER],Table2[ORDER]),0))
  • To post as a guest, your comment is unpublished.
    Wisam Nima · 1 years ago
    could you please help me with this issue

    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 Radio
    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.
  • To post as a guest, your comment is unpublished.
    Cooper · 1 years ago
    This formula doesn't
    work for me just keeps giving me "0"
    • To post as a guest, your comment is unpublished.
      Sunny · 1 years ago
      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.
      • To post as a guest, your comment is unpublished.
        F.Howard · 1 years ago
        Did you get to the bottom of this one? Mine is showing '0' too.
        • To post as a guest, your comment is unpublished.
          Sunny · 1 years ago
          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.
  • To post as a guest, your comment is unpublished.
    Thad · 2 years ago
    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)