+ Reply to Thread
Results 1 to 8 of 8

vlookup function

  1. #1
    Registered User
    Join Date
    07-27-2012
    Location
    United States
    MS-Off Ver
    Excel 2007 and 2003
    Posts
    12

    vlookup function

    does the first criteria for the VLookup function have to be a cell or can it be a string of text?

    Thanks


    Please Login or Register  to view this content.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: vlookup function

    Hi edoptx,

    First criteria in vlookup function is "lookup_value" as explained below:-

    lookup_value Required. The value to search in the first column of the table or range. The lookup_value argument can be a value or a reference. If the value you supply for the lookup_value argument is smaller than the smallest value in the first column of the table_array argument, VLOOKUP returns the #N/A error value.

    It is a cell and not the collection of texts (i.e., String)

    Whatever you have in lookup_value will have to be there in your data table as well.
    In your case QuestNum is appears to be one question number and it can't be more than one question papers... unless your data is arranged in that way
    e.g., A1 is 1 and your datatable has 1 in first column -> it will work
    e.g., A2 is 1,2,3 and your datatable has 1,2,3 in first column BUT in differenct cells -> it wont work..
    I hope this is clear now..

    Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    07-27-2012
    Location
    United States
    MS-Off Ver
    Excel 2007 and 2003
    Posts
    12

    Re: vlookup function

    thanks for the reply.

    so if Questnum= com2 for example
    the Vlookup will find where com2 exists and store it as Qest

    does this work well with info on different sheets or is there a better way to write it?

    thank you.

  4. #4
    Registered User
    Join Date
    07-27-2012
    Location
    United States
    MS-Off Ver
    Excel 2007 and 2003
    Posts
    12

    Re: vlookup function

    thanks for the reply.

    so if Questnum= com2 for example
    the Vlookup will find where com2 exists and store it as Qest

    does this work well with info on different sheets or is there a better way to write it?

    thank you.

  5. #5
    Registered User
    Join Date
    07-27-2012
    Location
    United States
    MS-Off Ver
    Excel 2007 and 2003
    Posts
    12

    Re: vlookup function

    thanks for the reply.

    so if Questnum= com2 for example
    the Vlookup will find where com2 exists and store it as Qest

    does this work well with info on different sheets or is there a better way to write it?

    thank you.
    Last edited by edoptx; 08-13-2012 at 12:30 PM. Reason: delete

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: vlookup function

    Hi edoptx,


    As per your code:- "Qest = Application.WorksheetFunction.VLookup(Questnum, mylookup, 3, False)", it will check questnum in range mylookup and will return result from column 3 and yes that will get stored in Qest

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  7. #7
    Registered User
    Join Date
    07-27-2012
    Location
    United States
    MS-Off Ver
    Excel 2007 and 2003
    Posts
    12

    Re: vlookup function

    thank you

    Edoptx

  8. #8
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: vlookup function

    You are welcome Edoptx..

    Cheers

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ Reply to Thread

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.6.0 RC 1