+ Reply to Thread
Results 1 to 8 of 8

Unique Number of Values based on Date Columns

  1. #1
    Forum Contributor
    Join Date
    02-27-2007
    Posts
    156

    Unique Number of Values based on Date Columns

    I have a 4 column Spreadsheet

    Column A is a Name
    Column B is a Date
    Column C is a Date
    Column D,E have two specific dates one in D2 and one in E2 (start and end)



    I need to know if there is a way that I can have Excel look through all of the rows (could be thousands) and if the date in column B is greater than the date I have entered in D2 AND the date that I have in column C is less than the date that I have in E2 tell me how many unique Names I have in column A. End result of the formula will be an integer value


    Sample Worksheet is attached.
    Attached Files Attached Files

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Unique Number of Values based on Date Columns

    Try this array formula in F2 and copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    ***Array formula
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.
    You will know the array is active when you see curly braces { } appear around your formula.
    If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Contributor
    Join Date
    02-27-2007
    Posts
    156

    Re: Unique Number of Values based on Date Columns

    Thanks for such a quick response.

    Not sure I fully understand what is going on with the formula... I've substituted the appropriate values for the data in my larger spreadsheet. I end up getting a single name instead of what I would expect which would be a number of 1, 2 or 3 - (there are only 3 possibilities for name).

    In that last COUNTIF what is the reference to F$1:F$1... also can I do the A$2:A$537 (etc.) to actually not have the upper limit... the spreadsheet continually adds rows... I don't want to have to adjust the formula for added rows.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Unique Number of Values based on Date Columns

    In my formula it is F$1:$F1 and not F$1:F$1 this why you only see one name listed. You can increase the upper limit to a reasonable size.

  5. #5
    Forum Contributor
    Join Date
    02-27-2007
    Posts
    156

    Re: Unique Number of Values based on Date Columns

    Direct Paste of this formula into my example spreadsheet produces "Another Name" as the result.

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Unique Number of Values based on Date Columns

    Sorry, but there is not much I can do for you from here. Did you read the instructions on how to enter array formula?
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    02-27-2007
    Posts
    156

    Re: Unique Number of Values based on Date Columns

    I dont think that I made my request clear... I really wasn't looking for the names themselves but actually just the count of unique names. I would expect this to be an integer and for the example worksheet the result should be a 2.

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,581

    Re: Unique Number of Values based on Date Columns

    Helper column D is used. It can be Hidden also.
    in D2, ten drag down.

    =IF(AND(B2>$F$2,C2<$G$2),A2,"")

    In H2, ARRAY formula

    =SUM(1/(COUNTIF(D2:D537,D2:D537)))-1

    ARRAY formula is used

    To enter ARRAY formula
    Paste the formula
    Press F2
    Press Ctrl+Shift+Enter keys together.
    formula will be covered with{} brackets by excel.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Find count of Unique or Duplicate Values based on Concatenated values in 2 columns
    By bdicarlo1 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-03-2014, 12:42 AM
  2. Count Unique values in Column based on values in other columns
    By dmschave in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-17-2014, 11:06 AM
  3. [SOLVED] Filter for Unique Values based on Two Columns
    By jfried11 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-07-2014, 09:48 AM
  4. Return number of unique values based on values in other column
    By Medir in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-26-2013, 11:17 AM
  5. Replies: 1
    Last Post: 11-16-2013, 05:18 AM
  6. Count Unique Values based on 2 columns
    By hecgroups in forum Excel Programming / VBA / Macros
    Replies: 33
    Last Post: 02-14-2012, 11:27 AM
  7. count unique values in columns based on date values
    By cclntn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-29-2010, 06:16 PM
  8. Look across values in 12 columns, return the number of unique values
    By NukedWhale in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-21-2009, 05:18 PM

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