+ Reply to Thread
Results 1 to 8 of 8

Remove duplicates but leave the lowest value

  1. #1
    Registered User
    Join Date
    09-30-2008
    Location
    USA
    MS-Off Ver
    2010
    Posts
    36

    Remove duplicates but leave the lowest value

    Hi,

    I have a Excel 2010 spreadsheet with duplicated item numbers in one column with varying values in another.

    Something like this:

    Column A Column B
    4350-R 4.50
    4350-R 4.50
    4350-R 5.50
    4350-R 5.70
    4850-B 4.15
    4850-B 4.15
    4850-B 4.15
    4850-B 5.85
    4850-B 5.85
    4850-B 5.95
    4850-B 6.15

    I want to delete all duplicates in column A but leaving the row with the lowest value in column B. Even if the values 4.50 and 4.15 are duplicated, one only row for each is left.

    In the above example I need this.

    Column A Column B
    4350-R 4.50
    4850-B 4.15

    Is there a way of doing this? I'm having 240,000 rows of data!

    Any help appreciated.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Remove duplicates but leave the lowest value

    Hi WT,

    Not a problem. I've given the steps in the attached. I think I can do this problem in about 2 minutes, with all those rows. No VBA needed just follow the steps.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    09-30-2008
    Location
    USA
    MS-Off Ver
    2010
    Posts
    36

    Re: Remove duplicates but leave the lowest value

    Hi Marvin,
    I appreciate your response. It worked like a charm, very good.

    It will be so easy if the results wanted change a little bit? For example if I wanted the results like this:

    4350-R 4.50
    4350-R 5.50
    4350-R 5.70
    4850-B 4.15
    4850-B 5.85
    4850-B 5.95
    4850-B 6.15

    I know the remove duplicates from excel would do that, but in my case values on Col B could be the same for multiple items on Col A. For ex. there could be item 5420-B with 4.50 value on B.

    Thanks!

  4. #4
    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: Remove duplicates but leave the lowest value

    Or

    In C1 and copy down

    =IF(MIN($B$1:$B$11)=B1,"",COUNTIF(A$1:B1,B1))

    then in A14 use this array formula and pull it across and down

    =IFERROR(INDEX(A:A,SMALL(IF(($C$1:$C$11<>"")*($C$1:$C$11=1),ROW($C$1:$C$11)),ROWS(A$1:A1))),"")

    ***Array formula must be entered by using key combination of CTRL+SHIFT+ENTER and not just ENTER

    Row\Col
    A
    B
    C
    1
    4850-B
    4.15
    2
    4850-B
    4.15
    3
    4850-B
    4.15
    4
    4350-R
    4.5
    1
    5
    4350-R
    4.5
    2
    6
    4350-R
    5.5
    1
    7
    4350-R
    5.7
    1
    8
    4850-B
    5.85
    1
    9
    4850-B
    5.85
    2
    10
    4850-B
    5.95
    1
    11
    4850-B
    6.15
    1
    12
    13
    14
    4350-R
    4.5
    15
    4350-R
    5.5
    16
    4350-R
    5.7
    17
    4850-B
    5.85
    18
    4850-B
    5.95
    19
    4850-B
    6.15
    Last edited by AlKey; 03-21-2015 at 10:40 AM.
    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

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Remove duplicates but leave the lowest value

    Hi WT,

    I think my method does exactly what you want. It will remove the duplicate using the CountIF formulas in my example above.

  6. #6
    Registered User
    Join Date
    09-30-2008
    Location
    USA
    MS-Off Ver
    2010
    Posts
    36

    Re: Remove duplicates but leave the lowest value

    Quote Originally Posted by MarvinP View Post
    Hi WT,

    I think my method does exactly what you want. It will remove the duplicate using the CountIF formulas in my example above.
    Yes Marvin, your method worked as expected.

    I just changed a little bit the criteria so another approach is needed. That is achieved with the AlKey workaround.

    Thank you to both of you!

  7. #7
    Registered User
    Join Date
    09-30-2008
    Location
    USA
    MS-Off Ver
    2010
    Posts
    36

    Re: Remove duplicates but leave the lowest value

    Quote Originally Posted by AlKey View Post
    Or

    In C1 and copy down

    =IF(MIN($B$1:$B$11)=B1,"",COUNTIF(A$1:B1,B1))
    Thank you AlKey, this approach do exactly the criteria. Thank you!

  8. #8
    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: Remove duplicates but leave the lowest value

    Appreciate your feedback!

    Please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools -> Mark thread as Solved).

+ 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. Remove 'duplicates' to leaving lowest value
    By alseeon in forum Excel General
    Replies: 9
    Last Post: 06-29-2015, 06:22 AM
  2. [SOLVED] Remove duplicates without removing cells (leave blank)
    By RobertOHare in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-10-2013, 09:57 AM
  3. Highlight lowest 5 out of 10 scores in a row without duplicates
    By Jjoseph6969 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-29-2013, 06:14 PM
  4. Conditional Formatting Lowest Value of Duplicates
    By n3sky in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-21-2011, 05:48 PM
  5. Delete Duplicates Leave one
    By bangelta in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2010, 06:47 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