+ Reply to Thread
Results 1 to 20 of 20

Count unique values within duplicate sets

  1. #1
    Registered User
    Join Date
    10-29-2023
    Location
    Christchurch, new Zealand
    MS-Off Ver
    365
    Posts
    7

    Count unique values within duplicate sets

    In the attached spreadsheet column C contains the duplicate sets
    Column C contains the values to count that are unique.
    I have manually entered the row result in column P and need a formula to supply the count.
    The purpose is to the delete the duplicates in column C and retain the count of unique values that existed in column P
    Last edited by 6StringJazzer; 10-30-2023 at 05:20 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Count unique values within duplicate sets

    Not sure I understand the logic for the values in column P.

    Anyway, clear column P and put this in cell P1:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Filter column P on values greater than 1 and delete the visible records
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-29-2023
    Location
    Christchurch, new Zealand
    MS-Off Ver
    365
    Posts
    7

    Re: Count unique values within duplicate sets

    Trevor, thank you
    I get #SPILL!
    There is a heading row and 2850 rows
    I believe I changed the formula correctly in the example attachment?
    Last edited by 6StringJazzer; 10-30-2023 at 05:20 PM.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Count unique values within duplicate sets

    Did you delete the contents of column P? I did . . . please see attached.
    Last edited by 6StringJazzer; 10-30-2023 at 05:21 PM.

  5. #5
    Registered User
    Join Date
    10-29-2023
    Location
    Christchurch, new Zealand
    MS-Off Ver
    365
    Posts
    7

    Re: Count unique values within duplicate sets

    Trevor, thank you for the fix!
    However, a misunderstanding?
    By unique I meant not repeated/duplicated.
    The formula counts all entries in the duplicate sets
    What I need is a count of unique entries in the duplicate sets
    The attached spreadsheet counts 25 entries in column P for 30 Langdons Road in column M
    The count should be 1 as all 25 are entries are identical not unique (in my terminology!).
    Last edited by Garthh; 10-30-2023 at 05:50 PM. Reason: New example

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Count unique values within duplicate sets

    All attachments have been removed because they appear to contain real email addresses and street addresses.

    Please remove any private data before attaching files.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Count unique values within duplicate sets

    Use this instead and filter on 1 for the unique/non-duplicated values, or <>1 for the duplicates.

  8. #8
    Registered User
    Join Date
    10-29-2023
    Location
    Christchurch, new Zealand
    MS-Off Ver
    365
    Posts
    7

    Re: Count unique values within duplicate sets

    Trevor, I'm a novice
    Use this instead? What?
    What I need is the number of unique entries on each row of the duplicate set so I can delete duplicates and retain the number of unique addresses. The purpose is the obtain only the number of unique addresses (column M) associated with a contract number (column C)

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Count unique values within duplicate sets

    Oops ... in too much of a hurry.

    The first formula, adjusted to reference column A:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This will give a counter within each contract in column A

    This is the formula that I meant to post:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This will give a count of each contract

    Please see the attached

  10. #10
    Registered User
    Join Date
    10-29-2023
    Location
    Christchurch, new Zealand
    MS-Off Ver
    365
    Posts
    7

    Re: Count unique values within duplicate sets

    Trevor, thank you again
    What I need is the total count of unique values on each row of a duplicate set
    Does the attached spreadsheet make more sense?
    Column N is the count I need

  11. #11
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Count unique values within duplicate sets

    You could use this, copied down:

    =ROWS(UNIQUE(FILTER($M$2:$M$30,$C$2:$C$30=C2)))
    Rory

  12. #12
    Registered User
    Join Date
    10-29-2023
    Location
    Christchurch, new Zealand
    MS-Off Ver
    365
    Posts
    7

    Re: Count unique values within duplicate sets

    Rory, thank you - works for me!
    I have 2850 rows to count so will change the M and C ranges then delete the duplicates in column C

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Count unique values within duplicate sets

    Taking Rory's formula, instead of copying down, clear the results in the output column and then use:

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

  14. #14
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: Count unique values within duplicate sets

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  15. #15
    Registered User
    Join Date
    10-29-2023
    Location
    Christchurch, new Zealand
    MS-Off Ver
    365
    Posts
    7
    Quote Originally Posted by TMS View Post
    Taking Rory's formula, instead of copying down, clear the results in the output column and then use:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor, thank you for your effort.
    All resolved now

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Count unique values within duplicate sets

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  17. #17
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Count unique values within duplicate sets

    Quote Originally Posted by TMS View Post
    Taking Rory's formula, instead of copying down, clear the results in the output column and then use:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you have LAMBDA and BYROW of course.

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Count unique values within duplicate sets

    The OP's profile says 365, Rory.

  19. #19
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Count unique values within duplicate sets

    That doesn't guarantee it - it depends what release channel they are on. I have 365 at work but we're on the slowest semi-annual release so I still don't have LAMBDA.

  20. #20
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Count unique values within duplicate sets

    Agreed, but he also said "all resolved" in post #15, so my sleuthing skills tell me that his version is probably new enough.

    This is why we prefer 365 users to say which version they have in their profiles (e.g. MS 365 v. 2308).

+ 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] Count duplicate sets of 2 numbers
    By Gulya in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-08-2021, 01:31 AM
  2. [SOLVED] Unique count based on year excluding duplicate values from previous years
    By Estevaoba in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-07-2020, 08:39 PM
  3. MIN MAX using duplicate values across 3 sets of numbers
    By mrwiley in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 12-03-2019, 07:04 AM
  4. Replies: 8
    Last Post: 05-08-2019, 11:38 AM
  5. [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
  6. [SOLVED] Count then Delete Duplicate Values and put count next to now unique value
    By flipjarg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-12-2014, 04:22 PM
  7. [SOLVED] ListBox of Unique values to also display Duplicate(Count)
    By coreytroy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-26-2013, 04:49 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