+ Reply to Thread
Results 1 to 6 of 6

Thread: Vlookup Help

  1. #1
    Registered User
    Join Date
    04-21-2009
    Location
    USA
    MS-Off Ver
    2007
    Posts
    70

    Vlookup Help

    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.
    Attached Files Attached Files
    Last edited by aharvestofhealth; 02-18-2010 at 02:13 PM.

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

    Re: Vlookup Help

    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.

  3. #3
    Registered User
    Join Date
    04-21-2009
    Location
    USA
    MS-Off Ver
    2007
    Posts
    70

    Re: Vlookup Help

    Quote Originally Posted by NBVC View Post
    Remove Data Validation and try:

    =IF(ISNUMBER(MATCH(Q2,Sheet2!A:A,0)),VLOOKUP(Q2,Sheet2!A:C,3,0),"EACH")

    copied down
    Beautiful! You guys are amazing!!!

  4. #4
    Registered User
    Join Date
    04-21-2009
    Location
    USA
    MS-Off Ver
    2007
    Posts
    70

    Re: Vlookup Help

    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?

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

    Re: Vlookup Help

    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.

  6. #6
    Registered User
    Join Date
    04-21-2009
    Location
    USA
    MS-Off Ver
    2007
    Posts
    70

    Re: Vlookup Help

    Thanks. Works perfectly!

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