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
Last edited by Dannypak; 03-09-2010 at 02:07 PM. Reason: Problem Solved
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.
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...
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon 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!)
Thank you both very very much!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks