+ Reply to Thread
Results 1 to 7 of 7

Count Unique Values within date range

  1. #1
    Registered User
    Join Date
    03-15-2010
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    10

    Count Unique Values within date range

    Forum Guru's,

    I'm having difficulty figuring out how to do some counting as the column I would like to count has duplicates and I simply need the unique values.

    Below is the formula I use to simply count how many total records fall within the specified date range. The date range is contained in I7 as the start date and K7 as the end date.

    The data being counted is housed in a separate tab, Weekly Pre-sale Physical.

    =COUNTIFS('Weekly Pre-sale Physical'!$I$3:$I$173,">="&I$7,'Weekly Pre-sale Physical'!$I$3:$I$173,"<="&K$7)

    In column B of that tab, we keep a list of serial like numbers (29730) that I would like to count, based on the date range above and only unique values as we may list that serial number twice.

    I've tried all of the Unique Value formula's I can find but can't seem to accommodate for the "date range" as described.

    Any thoughts? Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Count Unique Values within date range

    Hmm.. Probably a Pivot table would be best solution...

    However, didn't quite get what you should have for inputs and outputs so tra look for your own based on this example:
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-15-2010
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Count Unique Values within date range

    Thanks, I should spend some more time learning how to use pivot tables.

    The goal however is to report the data on the Monthly Survey Report tab Column C row 13. In this report, we are at times surveying multiple addresses for a single opportunity. I'm trying to calculate the number of opportunities within the date range.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Count Unique Values within date range

    Array formulas don't work in merged cells so you need to put this somewhere else and/or unmerge C12 but this will give you a unique count for column B within the dates specified

    =SUM(IF(FREQUENCY(IF('Weekly Pre-sale Physical'!$I$3:$I$173>=C$7,IF('Weekly Pre-sale Physical'!$I$3:$I$173<=E$7,IF('Weekly Pre-sale Physical'!$B$3:$B$173<>"",MATCH('Weekly Pre-sale Physical'!$B$3:$B$173,'Weekly Pre-sale Physical'!$B$3:$B$173,0)))),ROW('Weekly Pre-sale Physical'!$B$3:$B$173)-ROW('Weekly Pre-sale Physical'!$B$3)+1),1))

    confirmed with CTRL+SHIFT+ENTER
    Audere est facere

  5. #5
    Registered User
    Join Date
    03-15-2010
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Count Unique Values within date range

    Holly Smokes! Works like a charm! Thank you!

  6. #6
    Registered User
    Join Date
    11-18-2011
    Location
    Sydney, Australia
    MS-Off Ver
    the slsx version
    Posts
    1

    Re: Count Unique Values within date range

    Daddylonglegs,

    I've just used your formula to solve my own problem. You have saved me manually counting how many unique bits of data there were in 1068 twelve month periods. I cannot tell you how happy you have made me. Thank you so very much.

  7. #7
    Registered User
    Join Date
    09-20-2012
    Location
    Global Footprint
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Count Unique Values within date range

    Thanks daddylonglegs! You made me aware of the frequency function, which I think I will be using a lot in my reporting.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1