+ Reply to Thread
Results 1 to 13 of 13

Nested (?) formula/function to count unique entries

  1. #1
    Forum Contributor
    Join Date
    10-26-2011
    Location
    Ottawa, ON Canada
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    128

    Nested (?) formula/function to count unique entries

    Excel_forum_query.xls

    I am trying to get a formula to count unique entires based on the date entered.

    Sheet "DAY TO DAY" will have the data that will list the date in column A, and "Event Location" in column C.

    On the "Daily Business Report" in column "M" I would like it to count the # of unique entries based off the date for that particular row.

    For the attached sample, M6 on the Daily Business report would count all unique entries in C:C of the DAY TO DAY sheet, that have the same date in DAY TO DAY A:A

    It's easier to look at the attached than to explain!

    I've seen Frequency samples, but am not sure if they are what I need....

  2. #2
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Nested (?) formula/function to count unique entries

    In Sheet 2.. C6..
    use array formula as..

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ...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. Press F2 on that cell and try again.

    PS.. EDIT
    OOPS.. just notice.. MAC Excel.. Crossing finger.. not sure will work or not..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  3. #3
    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: Nested (?) formula/function to count unique entries

    Hi you can use Frequency function

    =SUM(IF(FREQUENCY('DAY TO DAY'!A4:A20,'DAY TO DAY'!A4:A20)>0,1))
    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

  4. #4
    Forum Contributor
    Join Date
    10-26-2011
    Location
    Ottawa, ON Canada
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    128

    Re: Nested (?) formula/function to count unique entries

    Thanks both. AlKey, I need to count unique values in column C of DAY TO DAY based off the A column.

    Debraj, yours worked just fine, however I'm looking for it to look at the entire column (DAY TO DAY A:A and DAY TO DAY C:C) Will the array still work changing to A:A / C:C? It seemed to slow down and not give a value

  5. #5
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Nested (?) formula/function to count unique entries

    In M6

    =SUMPRODUCT(('DAY TO DAY'!$A$4:$A$20=A6)/COUNTIF('DAY TO DAY'!$C$4:$C$20,'DAY TO DAY'!$C$4:$C$20&""))

    copy down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  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: Nested (?) formula/function to count unique entries

    Here is in column C

    =SUM(IF(FREQUENCY(MATCH('DAY TO DAY'!C4:C20,'DAY TO DAY'!C4:C20,0),MATCH('DAY TO DAY'!C4:C20,'DAY TO DAY'!C4:C20,0))>0,1))

    And this is unique values in for M6

    Just copy and paste it in M6

    =INDEX('DAY TO DAY'!$C$4:$C$20,MATCH(0,INDEX(COUNTIF($M$5:M5,'DAY TO DAY'!$C$4:$C$20),0,0),0))
    Last edited by AlKey; 09-20-2013 at 05:56 PM.

  7. #7
    Forum Contributor
    Join Date
    10-26-2011
    Location
    Ottawa, ON Canada
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    128

    Re: Nested (?) formula/function to count unique entries

    Thanks again.

    It looks like the below formula does what I need... I just changed for more rows..

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    10-26-2011
    Location
    Ottawa, ON Canada
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    128

    Re: Nested (?) formula/function to count unique entries

    Excel_forum_query2.xlsOne issue I'm running into... The DAY TO DAY sheet is an ever growing list, so I'd need the formula to look at the whole sheet, not just the a certain range...

    When I do this, I seem to get a result that is fractional... See attached...

  9. #9
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Nested (?) formula/function to count unique entries

    Hambly,

    Are you sure that works? In C4 Day to day tab, just change the value to "Place 1" (without quote) & see the answer.

    Here is one generic way to count

    Array Formula, with CTRL+SHIFT+ENTER

    =SUM(IF(FREQUENCY(IF('DAY TO DAY'!A$4:A$20=A6,IF('DAY TO DAY'!C$4:C$20<>"",MATCH('DAY TO DAY'!C$4:C$20,'DAY TO DAY'!C$4:C$20,0))),ROW('DAY TO DAY'!C$4:C$20)-ROW('DAY TO DAY'!C$4)+1),1))

    With Just ENTER

    =SUMPRODUCT(('DAY TO DAY'!A$4:A$20=A6)*('DAY TO DAY'!C$4:C$20<>"")*(MATCH('DAY TO DAY'!A$4:A$20&"_"&'DAY TO DAY'!C$4:C$20,'DAY TO DAY'!A$4:A$20&"_"&'DAY TO DAY'!C$4:C$20,0)=ROW('DAY TO DAY'!A$4:A$20)-ROW('DAY TO DAY'!A$4)+1))
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  10. #10
    Forum Contributor
    Join Date
    10-26-2011
    Location
    Ottawa, ON Canada
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    128

    Re: Nested (?) formula/function to count unique entries

    Thanks Haseeb.

    Yes, the Array formula seems to work well. Again, I'm wanting the formula to look at column A and C rather than just a certain range (A4:A20)... Will the array work looking at the whole column? It seems that involves a lot of calculating on Excels part, slowing it down? I could guess how many rows I will use.... I tried it with a range of A4:A8000 and that seemed to work fine..

  11. #11
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Nested (?) formula/function to count unique entries

    Hambly, you can use dynamic range in the formula. SO whenever add/delete entries in day to day tab, range will be adjusted. This way formula always looking only in used cells.

    I used 4 named ranges in your file:

    Name: FirstRow
    Refers to: =ROW('DAY TO DAY'!$A$2)

    Name: LastRow
    Refers to: =MATCH(100^100,'DAY TO DAY'!$A:$A)

    Name: Dates
    Refers to: =INDEX('DAY TO DAY'!$A:$A,FirstRow):INDEX('DAY TO DAY'!$A:$A,LastRow)

    Name: EventLocation
    Refers to: =INDEX('DAY TO DAY'!$C:$C,FirstRow):INDEX('DAY TO DAY'!$C:$C,LastRow)

    Then used in M6,

    =SUM(IF(FREQUENCY(IF(Dates=A6,IF(EventLocation<>"",MATCH(EventLocation,EventLocation,0))),ROW(Dates)-FirstRow+1),1))

    See attached file.
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    10-26-2011
    Location
    Ottawa, ON Canada
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    128

    Re: Nested (?) formula/function to count unique entries

    Amazing.... Thanks Haseeb... Seems to do the job perfectly....

    I'll test a little more, then mark as solved...

    Thanks again!

  13. #13
    Forum Contributor
    Join Date
    10-26-2011
    Location
    Ottawa, ON Canada
    MS-Off Ver
    Excel 2011 for Mac
    Posts
    128

    Re: Nested (?) formula/function to count unique entries

    DELETE POST - My mistake.
    Attached Files Attached Files
    Last edited by hambly; 10-01-2013 at 09:26 AM. Reason: Incorrect statement.

+ 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. Count number of unique entries in a range and drag formula
    By pedrofogao21 in forum Excel General
    Replies: 2
    Last Post: 03-22-2012, 11:31 AM
  2. [SOLVED] &amp;quot;COUNTU&amp;quot; function in Excel to count unique entries in a range
    By WayneL in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 09-06-2005, 06:05 AM
  3. "COUNTU" function in Excel to count unique entries in a range
    By WayneL in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 09-06-2005, 03:05 AM
  4. "COUNTU" function in Excel to count unique entries in a range
    By WayneL in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 09-06-2005, 02:05 AM
  5. [SOLVED] "COUNTU" function in Excel to count unique entries in a range
    By WayneL in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 09-05-2005, 11:05 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