+ Reply to Thread
Results 1 to 6 of 6

Take data from 1 list and put with match in another.

  1. #1
    Registered User
    Join Date
    08-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    57

    Take data from 1 list and put with match in another.

    Okay, so I have 2 lists. One has about 27,000 entries and the other has about 10,000. The list with 27,000 has an entry and then a code attached. I need to get the codes from that list to their corresponding match on the list of 10,000.

    Now I'm sure there is an easier way, and if there is please use that way, but I went ahead and was going to simply do a vlookup and bring the matches over that way. For some reason, my Vlookup formula isn't returning right. I haven't used Vlookups in a while, but the formula should be correct if my memory serves me (guessing it doesn't).

    I attached an example of my problem with my faulty vlookup formula. Basically I want to take match the codes in A:A to the correct Entries in G:G.

    Is there an easier way to purge data that doesn't have a matching Entry in both columns?

    Thanks.
    Last edited by Fcroft; 07-29-2010 at 12:26 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: Take data from 1 list and put with match in another.

    VLOOKUP is perfectly fine for the task of getting the code from the 27k list onto the 10k list.

    Col A - 27k values
    Col B - 27k codes

    Col G - 10k values to match

    Assuming row1 is your titles and the data starts in row2..in H2, this, copied down:
    =VLOOKUP(G2, A:B, 2, 0)

    That will give you a list of matching codes and an error message on the ones that don't match.

    Turn on the AutoFilter and filter that column for all the error codes, delete all the values left visible, then turn off the AutoFilter, you will be left with only matching values.
    _________________
    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-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Take data from 1 list and put with match in another.

    Sorry, forgot attachement.
    Attached Files Attached Files

  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: Take data from 1 list and put with match in another.

    You're misusing VLOOKUP. VLOOKUP() reads the first column in a range of columns for a match, and when a match is found in the first column, a value from the same row in a column to the right is returned.

    For your data format, swap the two columns and this will work:
    =VLOOKUP(G2,Table,2,FALSE)


    Else, you will have to change methods, this in H2 and copied down:
    =INDEX(A:A, MATCH(G2,B:B, 1))

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Take data from 1 list and put with match in another.

    Another way might be
    In G2
    Please Login or Register  to view this content.
    Or to hide #N/A
    Please Login or Register  to view this content.
    Drag/Fill Down

    Hope this helps
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  6. #6
    Registered User
    Join Date
    08-28-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    57

    Re: Take data from 1 list and put with match in another.

    Hah, yeah I just swapped the two columns that I was using as a table and it works now. I guess every other time I've used Vlookup, I just got lucky with the fact that the data was in the right order. Thanks and I'll go from here.

+ 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