+ Reply to Thread
Results 1 to 4 of 4

Delete Duplicated Row, based upon number of Cells where data is available.

  1. #1
    Registered User
    Join Date
    08-15-2013
    Location
    West Midlands, UK
    MS-Off Ver
    Excel 2010
    Posts
    5

    Delete Duplicated Row, based upon number of Cells where data is available.

    Hi All,

    Please see attached Spreadsheet.

    Normally, I would try to solve a VBA problem myself and post if I cannot find the answer; however in this case I do not even know how to get started.

    Looking in the attached.
    1. I have done a COUNTIF Formula (Column AT), to identify if there is a duplicate in Column 'O'.
    2. In Column AU, I have counted the number of times relevant data is apparent in a row.
    3. Looking at Rows 17 & 18, you can see a duplicate Container Number. I want to remove the one that has the lowest number in Column AU. In this case, Row 18.
    4. The data may not always be sorted by Container Number and these could be split all over.

    If anyone could assist on this then I would be grateful. This needs to be completed using a Macro; as this is completed daily and would be labour intensive if completed manually.

    Thanks,
    J
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Delete Duplicated Row, based upon number of Cells where data is available.

    Assuming only 1000 rows of data to deal with for now, here's a fast manual process that will still keep you in visual control.

    1) Put this array formula in AV2:

    =IF(AT2=1, "Keep", IF(MAX(IF($O$2:$O$1000=O2,$AU$2:$AU$1000, 0))=AU2, "Keep", "Delete"))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    If the array is properly activated and you then COPY THAT CELL DOWN column AV, all rows will say "Keep" except row18. If you get that result, you're good to go on activating the array.

    2) Scan visually down the data and make sure you're pleased with the results... and only see "delete" on the rows that should go away.

    3) Filter column AV for "Delete" only

    4) Delete all visible rows.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-15-2013
    Location
    West Midlands, UK
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Delete Duplicated Row, based upon number of Cells where data is available.

    Thanks Jerry,

    Appreciate the help; however other aspects of the data cleansing are completed by Macro and I wanted to be able to tie this all together within the Macro. IF I don't get any other responses then I will look at coding your formula and process into the Macro.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Delete Duplicated Row, based upon number of Cells where data is available.

    I would code that exact process into a macro.
    Please Login or Register  to view this content.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] delete duplicated rows based on a criteria in another column
    By melody10 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-08-2013, 06:53 AM
  2. how to delete duplicated data
    By luuckyoctopus in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-05-2012, 06:51 AM
  3. Delete both rows if data is duplicated
    By thillis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2009, 01:46 PM
  4. how to delete duplicated content from 2 cells
    By lucent88 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-12-2005, 06:05 PM
  5. Macro Help - Delete Duplicated Data
    By mccrimmon in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-02-2005, 09:05 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