+ Reply to Thread
Results 1 to 3 of 3

Counting Unique values within a specified date range

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Greenville, SC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Counting Unique values within a specified date range

    I have a worksheet with 10000 + lines. Column A2:A10000 contains quote numbers. These can be duplicates. Column B contains the date in which the quote was entered. These can be duplicates. I need a formula that will count the number of unique quote numbers (column A) that fall within a date range (from column B). The desired date range is to be entered by other users in cells K2 (start) and L2 (end). So if there are 5 lines within the given date range that have the same quote number, it would count them as 1.

    I have a pivot table in place that will do this, but I am designing an "executive summary" tab that the boss can use, as he is not adept at pivot tables. I need it so he can just enter the date range, and it spits out the numbers. I have the following formulas in place, but can't get the two to combine.

    To count the number of lines in the given date range:
    =COUNTIFS(B2:B10000,">="&K2,B2:B10000,"<="&L2)

    To count the number of uniqe quotes in the entire sheet:
    =SUM(IF(FREQUENCY(MATCH(A2:A910000,A2:A10000,0),MATCH(A2:A10000,A2:A10000,0))>0,1))


    Any help is GREATLY APPRECIATED!

  2. #2
    Forum Moderator Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Counting Unique values within a specified date range

    Hi

    One way.

    In D1 and copy down, use this.

    =COUNTIF($A$1:$A1,A1)

    Then amend your formula, like this.

    =COUNTIFS(B2:B10000,">="&K2;B2:B10000,"<="&L2;D2:D10000,1)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    09-27-2012
    Location
    Greenville, SC
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Counting Unique values within a specified date range

    Holy crap, you're a genious! Had to replace the semicolons with commas, but it works perfectly now.

    Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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