+ Reply to Thread
Results 1 to 6 of 6

Trim Duplicates

  1. #1
    Forum Contributor stockgoblin42's Avatar
    Join Date
    05-26-2011
    Location
    vancouver, canada
    MS-Off Ver
    Excel 2010
    Posts
    222

    Trim Duplicates

    Hi,

    I have a list of lines with slope values in column A. Each slope has 1 or more duplicates in this list. I'm trying to figure out a macro that would trim the list down to just the first 7 unique slopes and their first duplicate.

    So the list should be cut down to 14 lines, 7 pairs of lines with duplicate values in column A.

    Is this possible? Can only a genius figure this out?

    oh, watch out for the fact that a duplicate's match may occur within the first 7 lines.
    Also, there's a helper column already in column B.


    here's some sample data.

    any help is appreciated
    Attached Files Attached Files
    Last edited by stockgoblin42; 06-15-2013 at 08:26 AM.
    live logic & long prosper

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Trim Duplicates

    there are 550 pairs of unique values in column do you just want the first 7?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Contributor stockgoblin42's Avatar
    Join Date
    05-26-2011
    Location
    vancouver, canada
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Trim Duplicates

    yes, the first 7 slopes, including a duplicate's match if it's encountered in the first 7 lines.

    I tried just taking the first seven lines and getting their index matches but if the index match for, say line 2 is on line 4, then that doesn't work.
    Last edited by stockgoblin42; 06-15-2013 at 08:49 AM.

  4. #4
    Forum Contributor stockgoblin42's Avatar
    Join Date
    05-26-2011
    Location
    vancouver, canada
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Trim Duplicates

    okay, here's less sample data with that problem, a duplicate's match within the first seven lines...
    Attached Files Attached Files
    Last edited by stockgoblin42; 06-15-2013 at 09:20 AM.

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Trim Duplicates

    I don't know which sheet you are referring to.

    This workbook lists the unique values in Sheet2 Column A that have a duplicate within 7 rows of the first instance found.

    Is that what you mean?
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  6. #6
    Forum Contributor stockgoblin42's Avatar
    Join Date
    05-26-2011
    Location
    vancouver, canada
    MS-Off Ver
    Excel 2010
    Posts
    222

    Re: Trim Duplicates

    no sorry, it's much simpler than that.

    the sampledata is a list of pairs or triplicates, etc.. of paralell lines, slope values in Column A. There are too many. I want to only see the first seven pairs of parallel lines. So, I could just copy the first 7 lines to a new sheet and lookup the second instances of the column A values to give me 14 lines, 7 pairs of paralell lines.

    BUT...

    that only works if the first 7 values in column A are all different from each other. What do I do when they are not?

    sorry for the confusion

+ 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