+ Reply to Thread
Results 1 to 5 of 5

compare two columns, delete non matches in partial rows using shift up

Hybrid View

  1. #1
    Registered User
    Join Date
    02-03-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    25

    compare two columns, delete non matches in partial rows using shift up

    I have an issue that I think can be solved in a few different ways, I just can't figure out which would work the best (and take the least amount of time).

    I had a mailing list in a spreadsheet that was exported from a database and we've deleted quite a few names from it. Then we realized we left out an important piece of information so I exported the same list again and now I need to merge the two together but make sure I don't re-add the names we already deleted. Luckily, each name has a unique ID number, so I think that will help a bit.

    At first I thought the easiest way to fix this would be to sort both lists by ID number and view them side by side, deleting names from the second list that didn't appear on the first, but man, that was taking forever because my eyes started going buggy trying to compare those ID numbers.

    So then I pasted the ID number and missing piece of information into the first spreadsheet (still sorted by ID) and used a formula or conditional formatting (I actually can't remember which worked because I've tried so many things) and had it highlight duplicates of the ID number so it would be easy to see the data I needed to delete. The problem was, when I deleted the two cells and told it to shift the data up so the two ID number were in the same row, the formula would get messed up and I'd wind up with a REF error that I'd have to fix every time I deleted data.

    I know there's got to be a better way to do this than the ones I've tried already (I'm leaving out some really stupid things I tried because they're too embarrassing to admit to). If anyone has any suggestions, I'd be really grateful. I'm good with formulas and conditional formatting; I know nothing about VBA but I'm willing to give it a try.

    I've attached a very simplified version of what we're dealing with. In my example, I'm pretending we forgot to include the town and need to re-add it. test spreadsheet.xlsx

    I hope this makes sense. Thanks in advance...
    Last edited by acp; 05-24-2013 at 03:22 PM. Reason: marked as solved

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: compare two columns, delete non matches in partial rows using shift up

    Good old VLOOKUP. They should teach this function to third graders because EVERYONE will end up using it sooner or later.
    Put this in cell D2 in the first sheet and copy down:
    Formula: copy to clipboard
    =VLOOKUP(C2,'Master List (before edits)'!C:D,2,0)


    Proper way to ask for help, by the way, with a simple sample workbook. Thumb up.
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    Registered User
    Join Date
    02-03-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: compare two columns, delete non matches in partial rows using shift up

    Quote Originally Posted by Jacc View Post
    Good old VLOOKUP. They should teach this function to third graders because EVERYONE will end up using it sooner or later.
    Put this in cell D2 in the first sheet and copy down:
    Formula: copy to clipboard
    =VLOOKUP(C2,'Master List (before edits)'!C:D,2,0)


    Proper way to ask for help, by the way, with a simple sample workbook. Thumb up.
    This worked perfectly! I can't believe how much time I've wasted in the past (this happens to us a lot) and how much time I'll save in the future. I definitely need to learn more about VLOOKUP. I see it used here all the time, but I haven't really had the time to learn Excel properly; I just learn what I need to know at the time.

    Thanks for your help!!

  4. #4
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,883

    Re: compare two columns, delete non matches in partial rows using shift up


    ----------

  5. #5
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: compare two columns, delete non matches in partial rows using shift up

    Find the attached file with simple Index and Match function for all columns with ID.
    Vlookup is also correct method if you want only town.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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