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


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

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!
officetab bottom
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 · 10 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 · 2 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 · 2 years ago
    This formula doesn't
    work for me just keeps giving me "0"
    • To post as a guest, your comment is unpublished.
      Sunny · 2 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 · 2 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 · 2 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)