+ Reply to Thread
Results 1 to 6 of 6

Combining Rows - Keeping Unique and "New" Values & Merging Duplicate Values

  1. #1
    Registered User
    Join Date
    04-09-2014
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    18

    Combining Rows - Keeping Unique and "New" Values & Merging Duplicate Values

    I am in need of quite a bit of help. I do not know VBA, and I don't think I'll be able to figure out what I need to do on my own.

    I have a huge spreadsheet that is temporarily storing "member" information. I have quite a bit of semi-duplicate data.

    Example
    123456 | [email protected] | Jane | Smith | | Single <-- Older Record
    258369 | [email protected] | Jane | Smith | Houston | Married <-- Newer Record

    So, I need these rows combined: keeping the duplicate data and updating with the "newer" data (on the bottom row), but keeping the USERID with the smaller number.

    Result
    123456 | [email protected] | Jane | Smith | Houston | Married

    Is this even possible? I am assuming if it is that I would need VBA code or a macro.
    Otherwise, I have to do this all by hand - which is currently 600+ rows of data to fix. Out of 11,000+ rows, it's not horrible, but who wants to do this by hand?

    Can anyone help me out?
    Last edited by kimbekaw; 05-19-2014 at 07:19 PM.

  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: Combining Rows - Keeping Unique and "New" Values & Merging Duplicate Values

    How will this new macro determine rows that are truly a match? Certainly in 11,000 rows of data there could be two Jane Smith's that weren't the same person. If the macro is merging new data up into old rows except for just the first and last name fields, I'd wonder if real individuals are disappearing in the process.
    _________________
    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
    04-09-2014
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    18

    Re: Combining Rows - Keeping Unique and "New" Values & Merging Duplicate Values

    Quote Originally Posted by JBeaucaire View Post
    How will this new macro determine rows that are truly a match? Certainly in 11,000 rows of data there could be two Jane Smith's that weren't the same person. If the macro is merging new data up into old rows except for just the first and last name fields, I'd wonder if real individuals are disappearing in the process.
    Certainly that is a concern. I have the data filtered to show my duplicates - that's where the 600+ number comes from. Most of these will be duplicates. However, it is occasionally difficult to determine if a record is actually a new record with the same name or just a duplicate. The only way to ensure no loss of data is to through by hand a make judgement calls...which will undoubtedly result in the loss of some data.

    I have already found and merged duplicates (by hand) based on emails. It's just come down to the records in which emails have been changed and our old system & DBMS did not handle updating records very well. So, I'm trying to clean the data up. But the task is proving unwieldy at the moment.

  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: Combining Rows - Keeping Unique and "New" Values & Merging Duplicate Values

    Can you provide a sample workbook with the exact data layout and 10-20 rows of sample data to test a suggested solution on?

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  5. #5
    Registered User
    Join Date
    04-09-2014
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    18

    Re: Combining Rows - Keeping Unique and "New" Values & Merging Duplicate Values

    Here's a sample of what I need to clean up: problemsample2.xlsx

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

    Re: Combining Rows - Keeping Unique and "New" Values & Merging Duplicate Values

    This should do it:

    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.

  7. #7
    Registered User
    Join Date
    04-09-2014
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    18

    Re: Combining Rows - Keeping Unique and "New" Values & Merging Duplicate Values

    Thanks for your work. This codes did work on the sample I gave you, but it's not working for the entire database.
    I'm inserting a module -> pasting the code & running it. It processes, but very few of the records are merged. I have 689 rows total and the subroutine only gets it down to 635. Am I using the code incorrectly or is something wrong?


    Scratch that! It was a mistake on my part. Thank you, thank you!
    Last edited by kimbekaw; 05-21-2014 at 05:34 PM.

+ 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] Merging two list into one using formula and keeping only unique values
    By rbncpr in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 01-12-2020, 06:58 PM
  2. Replies: 0
    Last Post: 11-22-2013, 01:36 PM
  3. Sumif column "O" for excluding values with duplicate values in column "F"
    By jobell in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-04-2013, 08:42 PM
  4. [SOLVED] Help merging duplicate cells and combining other values
    By NRSmith82 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-25-2012, 05:47 PM
  5. Combining Values in rows and keeping unique values (adv. filtering?)
    By nguyeda in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2011, 01:48 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