+ Reply to Thread
Results 1 to 5 of 5

Counting Unique Numbers based on Date

  1. #1
    Registered User
    Join Date
    12-23-2010
    Location
    Oxnard, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Counting Unique Numbers based on Date

    I apologize if this has been covered, I tried searching and did not find anything.

    I have a spreadsheet where column B is a four digit number and column H are different dates. What I'm trying to do is count all dates that are 90 days in the past and greater, but only for the unique numbers in column B.

    The two pieces of code that I currently have are:

    Please Login or Register  to view this content.
    I just need a way to combine the two so it only counts column H if column B is a unique number. Any help with this would be greatly appreciated!

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

    Re: Counting Unique Numbers based on Date

    Hi.. Maybe something like this:

    =SUMPRODUCT(--(COUNTIF(B3:B1000, B3:B1000)=1), --(H3:H1000<=(TODAY()-90)))
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    12-23-2010
    Location
    Oxnard, CA
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Counting Unique Numbers based on Date

    Worked perfectly! I was trying to mess around with the sumproduct function but couldn't quite get it to work. (May be a newbie question but..) In the instance what is the "--" doing?

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,031

    Re: Counting Unique Numbers based on Date

    in principle: -- converting TRUE/FALSE into 1/0 (numbers)

    So when you have:

    =SUMPRODUCT(--(A1:A10=1))

    It will check numbers in a1 to A10 (for example)

    =SUMPRODUCT(--({1, 2, 3, 4, 5, 6, 7, 8, 9, 1}=1))

    And then it will compare it to =1

    =SUMPRODUCT(--({TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE})

    Now -- convert it to numbers (otherwise you can not calculate it)

    =SUMPRODUCT({1,0,0,0,0,0,0,0,0,1}) which is 2

  5. #5
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Counting Unique Numbers based on Date

    Hi
    the "--" is the double unary operator. It is well explained at this site

+ 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