+ Reply to Thread
Results 1 to 5 of 5

Worksheet VLookup Newbie Help

  1. #1
    Registered User
    Join Date
    10-30-2006
    Posts
    7

    Worksheet VLookup Newbie Help

    I have a problem. I have two worksheets one with classes and one with student info and I wanted to pull certain info from one worksheet to the other
    for example
    Student 1 appears 3 times under three different classes…That student has three fields of info on the other worksheet written 1 time. It needs to automatically pull the info from the 2nd worksheet list below based on ID number and fill it in to all the occurences of that student...I am using a Vlookup function but it is not working properly

    If you can help I have a sample excel file I can send....xls is an invalid file extension here

    any help would be appreciated
    -M

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    you can zip your xls and post it here. It would be easier to see the worksheet. How do you know on worksheet 2, that there are 3 occurrences of the student on worksheet 1?

  3. #3
    Registered User
    Join Date
    10-30-2006
    Posts
    7

    Here is the file

    Thanks for the zip tip

    I need the last few columns of first worksheet to reflect the info in the second...based on each student...
    I am getting "0" and NA messages..
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    You have actually done it correctly - well done The issues you are having are three fold.

    Firstly the student list on sheet 2 needs to be sorted in student number order. This is because Vlookup starts at the top of the list and then works down until it finds the number. If it overshoots based on alpha, it assumes the number is not there. Just select column C and click A to Z sort from the tool bar, and it will start working as you expect.

    Secondly, the zeros that are returned are just a formula representation of the blanks in your table. You can either switch of zeros on your destination sheet by selection Tools\Options and deselecting View Zeros, or you can filter them out by putting an if statement around your vlookup

    ie =if(result from vlookup=0,"",result from vlookup)

    Thirdly, Vlookup has a 4th option argument. You should put comma 0 at the end of your lookups. ie

    =VLOOKUP(C3,Modifications,2) should be =VLOOKUP(C3,Modifications,2,0)

    The default use of vlookup is to find the closest match. If you don't put ,0 at the end, the vlookup will return a different student's details if the number can't be found.

    Matt

  5. #5
    Registered User
    Join Date
    10-30-2006
    Posts
    7

    Thanks

    Thank you so much for the help...worked great...This is a great forum!

+ 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