+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    03-11-2009
    Location
    Seattle, WA
    MS-Off Ver
    Office 2007
    Posts
    47

    Red face Vlookup value from sheet1, copy past value to sheet2

    Hello,
    Looking for some help with Vlookup with the attached workbook.
    trying to find values from column A of worksheet1 in column A of worksheet 2.
    Then, fill Column C of Worksheet1 with "Yes/No" and if "Yes" copy corresponding value from Column B of Worksheet2 to Column D of Worksheet1.

    It sounds simple but I keep goofing up on this...

    Best regards,
    dan
    Attached Files Attached Files
    Last edited by Dannypak; 03-09-2010 at 02:07 PM. Reason: Problem Solved

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Vlookup value from sheet1, copy past value to sheet2

    In C2:

    =IF(ISNUMBER(MATCH(A2,sheet2!A:A,0)),"Yes","No")

    in D2:

    =IF(C2="Yes",VLOOKUP(A2,sheet2!A:B,2,0),"")

    copied down.

    Note: You can do that all in 1 formula:

    =IF(ISNUMBER(MATCH(A2,sheet2!A:A,0)),VLOOKUP(A2,sheet2!A:B,2,0),"")
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    18,228

    Re: Vlookup value from sheet1, copy past value to sheet2

    Not vba, but does what you want without it...

    In Sheet1 C2:
    =IF(ISNUMBER(MATCH($A2,sheet2!$A:$A, 0)),"Yes","No")
    ...copied down.

    In Sheet1 D2:
    =IF(ISNUMBER(MATCH($A2,sheet2!$A:$A, 0)),INDEX(sheet2!$B:$B, MATCH($A2, sheet2!$A:$A, 0)), "")
    ...copied down.

    You don't actually need column C. The column D formula leaves "blank" holes where no match is found, so it serves the same purpose that way.


    I use INDEX/MATCH instead of VLOOKUP because it's more robust, I can use it all the time, so I do...you can use VLOOKUP still as shown above...
    Attached Files Attached Files
    _________________
    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!)

  4. #4
    Registered User
    Join Date
    03-11-2009
    Location
    Seattle, WA
    MS-Off Ver
    Office 2007
    Posts
    47

    Thumbs up Re: Vlookup value from sheet1, copy past value to sheet2

    Thank you both very very much!

Thread Information

Users Browsing this Thread

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

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.2.0