+ Reply to Thread
Results 1 to 6 of 6

Help with duplicate values

  1. #1
    Registered User
    Join Date
    11-09-2009
    Location
    Minneapolis
    MS-Off Ver
    Excel 2003
    Posts
    14

    Help with duplicate values

    Hopefully I can illustrate my problem without confusing everyone!
    Here's my situation: I have a worksheet which looks like below.
    ColA ColB
    1 Red
    2 Red
    3 Red
    4 Dog
    5 Dog
    6 Blue
    7 Blue
    8 Green
    9 Green

    Is there a formula I can use to extract the 1st row of each duplicate set (column A having unique values, column B having duplicates)? So from above my result would be:
    ColA ColB
    1 Red
    4 Dog
    6 Blue
    8 Green
    Last edited by ironj32; 11-17-2009 at 01:49 PM.

  2. #2
    Forum Contributor
    Join Date
    12-02-2008
    Location
    India
    Posts
    118

    Re: Help with duplicate values

    In colC
    C2 =IF(B2=B1,"Repeat","First Value")

    Then u cud use autofilter and delete all rows having "Repeat"

    Hope this helps

    Regards
    Mohit
    Last edited by mohitspamz; 11-17-2009 at 01:13 PM.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Help with duplicate values

    If you have an empty row above, then in C2:

    =IF(B1=B2,"",MAX($C$1:C1)+1)

    copied down will indicate first record

    then, say in E2,

    =INDEX(A$2:A$10,MATCH(ROWS($E$2:$E2),$C$2:$C$10,0)) copied to next column and down equivalent number of rows as there are different categories...

    See attached.
    Attached Files Attached Files
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    11-09-2009
    Location
    Minneapolis
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Help with duplicate values

    Thanks! I ended up using NBVC's method...works like a charm.

  5. #5
    Registered User
    Join Date
    11-21-2016
    Location
    Boston
    MS-Off Ver
    2010
    Posts
    11

    Re: Help with duplicate values

    Hello, I have a similar problem but I would like to extract whole row and also add sum of 'number of times repeated'

    Example:
    ColA ColB ColC
    1 Red 12/7
    2 Red 12/7
    3 Red 12/6
    4 Dog 12/7
    5 Dog 12/7
    6 Blue 12/7
    7 Blue 12/7
    8 Green 12/7
    9 Green 12/7
    10 Green 12/6

    Result to be:
    ColA ColB ColC ColD
    1 Red 12/7 2
    3 Red 12/6 1
    4 Dog 12/7 2
    6 Blue 12/7 2
    8 Green 12/7 2
    10 Green 12/6 1

    Thank you

  6. #6
    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,647

    Re: Help with duplicate values

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
    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.

+ 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