I am trying to create a vlookup without success. I would like cell D2 (on Sheet1) to default to the value of "EACH", unless the value is found on Sheet2 (column C). If it is found on Sheet2, then I want it to match the unit beside the respective upc code (see Col Q on Sheet1, and Col A on Sheet2) . Then I would like to be able to drag down cell D2 and all cells on Sheet2 would match and any that do not match, would be filled with "Each". Desired results are shown in attached example file.
Last edited by aharvestofhealth; 02-18-2010 at 02:13 PM.
Remove Data Validation and try:
=IF(ISNUMBER(MATCH(Q2,Sheet2!A:A,0)),VLOOKUP(Q2,Sheet2!A:C,3,0),"EACH")
copied down
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.
One last question. If I have a upc on sheet2 without a unit, it returns a 0. How do I get it to just show a blank cell?
Try:
=IF(ISNUMBER(MATCH(Q2,Sheet2!A:A,0)),IF(VLOOKUP(Q2,Sheet2!A:C,3,0)=0,"",VLOOKUP(Q2,Sheet2!A:C,3,0)), "EACH")
You can also custom format the cells, using my first formula, as
;;;@
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.
Thanks. Works perfectly!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks