+ Reply to Thread
Results 1 to 8 of 8

Conditionally delete duplicates

  1. #1
    Registered User
    Join Date
    06-02-2015
    Location
    Spotsylvania. VA
    MS-Off Ver
    2007
    Posts
    4

    Conditionally delete duplicates

    Good afternoon!

    The practical background: I work in education and am trying to calculate pass rates. Sometimes students are allowed to retake a test if they fail, but my .csv download from the software lists all their scores, and I only want the highest score.

    What I want Excel to do: If student ID number (Column E) and Subject Code match (column D), only keep the highest score.
    *I have placed and "Expected results" example in the Excel document

    I have attached a sample spreadsheet here. The actual file I am working with has over 50,000 rows so I want to work smarter and not harder. Hopefully there is a formula that can help me! Possibly a variation of a VLOOKUP (which I have never used).

    I am an excel forum newbie so please let me know if you have any questions. I absolutely appreciate the help!
    Attached Files Attached Files
    Last edited by kweidle; 06-02-2015 at 12:58 PM.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Conditionally delete duplicates

    You get better help on your question if you add manualy the expected result in the excel file and post it again.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    06-02-2015
    Location
    Spotsylvania. VA
    MS-Off Ver
    2007
    Posts
    4

    Re: Conditionally delete duplicates

    Thank you very much oeldere! I have updated the excel document with expected results.

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Conditionally delete duplicates

    Here a solution with a pivot table.

    That is the way i should solve it.

    I will take a look to get the result, like you asked.

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Conditionally delete duplicates

    See the attached file.

    I used helpcolumn to get the result.

    I filtered on blanc and 2.

  6. #6
    Registered User
    Join Date
    06-02-2015
    Location
    Spotsylvania. VA
    MS-Off Ver
    2007
    Posts
    4

    Wink Re: Conditionally delete duplicates

    That worked out exactly the way I need it!

    I do have one question, where did the G20 come from? It was the only constant in the formal (I know the rest changed based on the row #). If I have 30,000 rows should that number by 30,000? I just want to make sure that my first equation is correct because I plan on just copying it down the column.

    =IF(COUNTIF($G$2:$G$20,$G2)=1,"",COUNTIF($G$2:$G2,$G2))

    Thank you for your continued help!

  7. #7
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Conditionally delete duplicates

    Yes that number should be 30.000.

    But I am afraid the file will collapse, since it is a lot of work for excel.

    I would try to use a smaller range.

    After the formula has been excecuted, copy => paste special values the range.

  8. #8
    Registered User
    Join Date
    06-02-2015
    Location
    Spotsylvania. VA
    MS-Off Ver
    2007
    Posts
    4

    Re: Conditionally delete duplicates

    So far my Excel file has not crashed and I am extremely thankful for your help! You were quick to reply and helped so much!

+ 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. Macro to find duplicates, concatenate cells, then delete old duplicates
    By givemepuppies in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-04-2016, 02:43 AM
  2. [SOLVED] Macro to find duplicates, concatenate Unique Values, then delete old duplicates
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-17-2013, 04:32 PM
  3. Find duplicates in a column and conditionally clear the data
    By kiran234 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-09-2011, 05:38 PM
  4. Replies: 17
    Last Post: 07-05-2011, 05:37 PM
  5. [SOLVED] Can I conditionally delete row in Excel? (if B3=0 delete row B)
    By Badger in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-22-2006, 09:25 PM

Tags for this Thread

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