+ Reply to Thread
Results 1 to 6 of 6

Selecting Duplicates to Keep

  1. #1
    Registered User
    Join Date
    06-28-2021
    Location
    Colorado, USA
    MS-Off Ver
    Office 365
    Posts
    25

    Selecting Duplicates to Keep

    Is there a formula that can be used in a helper column to help me decide which duplicate to keep and which to delete? Below is what I am trying to do

    Column A Column B
    Company A Status 1
    Company A Status 2
    Company B Status 1
    Company C Status 1
    Company C Status 2
    Company C Status 3
    Company C Status 4
    Company D Status 2
    Company E Status 1
    Company E Status 2

    So if there is no duplicate in column A, I want to keep that row, but if there is a duplicate in column A I want to keep status 1 and delete the row with status 2. There is a hierarchy of statuses to keep first. Please note this is not real data. The real data is not in any numerical or alphabetical order otherwise I would sort and remove duplicates.

    Example hierarchy:

    Status 1
    Status 2
    Status 3
    Status 4

    Thank you very much!

  2. #2
    Forum Contributor
    Join Date
    03-17-2010
    Location
    karachi
    MS-Off Ver
    Excel 2003
    Posts
    113

    Re: Selecting Duplicates to Keep

    =index(a$2:a$11,small(if(match($a$2:$a$11,$a$2:$a$11,0)=row($a$2:$a$11)-row($a$2)+1,row($a$2:$a$11)-row($a$2)+1),rows($a$2:a2)))

  3. #3
    Registered User
    Join Date
    06-28-2021
    Location
    Colorado, USA
    MS-Off Ver
    Office 365
    Posts
    25

    Re: Selecting Duplicates to Keep

    Thank you for your reply. I was a little bit confused because I put in this formula, but it is only giving me results from column A and I don't think it is taking column 2 into account?

  4. #4
    Forum Contributor
    Join Date
    03-17-2010
    Location
    karachi
    MS-Off Ver
    Excel 2003
    Posts
    113

    Re: Selecting Duplicates to Keep

    you drag it to column b

  5. #5
    Registered User
    Join Date
    06-28-2021
    Location
    Colorado, USA
    MS-Off Ver
    Office 365
    Posts
    25

    Re: Selecting Duplicates to Keep

    Ok, thank you! Then how is it determining which value from column B to keep, it looks like it is keeping the first status, which is not what I want to do. I want to be able to specify which one to keep.

  6. #6
    Registered User
    Join Date
    06-28-2021
    Location
    Colorado, USA
    MS-Off Ver
    Office 365
    Posts
    25

    Re: Selecting Duplicates to Keep

    I ended up just assigning a value to each status in another column, and then sorting and removing duplicates.

+ 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. Prevent duplicates when selecting random string from list
    By tulipxde in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-02-2020, 01:09 AM
  2. Replies: 8
    Last Post: 11-16-2014, 12:07 PM
  3. [SOLVED] Random selecting 20 items base on criteria with no duplicates
    By emina002 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 04-19-2013, 04:50 AM
  4. Selecting top 10 with many duplicates in column
    By mybadongt in forum Excel General
    Replies: 2
    Last Post: 01-24-2013, 05:42 PM
  5. [SOLVED] Selecting cells based on duplicates after first occurrence
    By anwaee2 in forum Excel General
    Replies: 0
    Last Post: 09-17-2012, 07:54 AM
  6. Replies: 1
    Last Post: 03-24-2011, 02:02 AM
  7. Selecting a Set of Random Numbers, Avoiding Duplicates
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-29-2005, 10:58 AM

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