+ Reply to Thread
Results 1 to 7 of 7

vlookup function, picking up the wrong row

  1. #1
    Registered User
    Join Date
    01-29-2009
    Location
    Barnsley, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    vlookup function, picking up the wrong row

    Hi,
    For some reason when doing a vlookup the figure pulled into my spreadsheet appears to be from the row above.

    My spreadsheet is like this

    A B
    1 LRTN =vlookup(a1,sheet2!A2:b50,2)


    Sheet two is a long list like this

    LRTL Software
    LRTN Mining
    LRTP Cole

    Basically i thought it should say mining, however it is picking up the one above, in this example 'software'

    Cheers
    Last edited by VBA Noob; 03-03-2009 at 10:03 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Really easy, vlookup function, picking up the wrong row

    =vlookup(a1,sheet2!A2:b50,2,FALSE)

  3. #3
    Registered User
    Join Date
    02-19-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003 and Excel 2007
    Posts
    37

    Re: Really easy, vlookup function, picking up the wrong row

    Try including the false parameter so the it is not a ranged look up!

    =vlookup(a1,sheet2!A2:b50,2,false)

  4. #4
    Registered User
    Join Date
    01-29-2009
    Location
    Barnsley, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Really easy, vlookup function, picking up the wrong row

    the false option doesnt make a difference!!

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Really easy, vlookup function, picking up the wrong row

    er, yes it does.... post a sample file.... presumably A1 contains LRTN ?

  6. #6
    Registered User
    Join Date
    01-29-2009
    Location
    Barnsley, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Really easy, vlookup function, picking up the wrong row

    its a really long list, i dunno if that makes a difference, the table im looking up has about 2000 rows in it....

    i cant post a file sorry as cant get on the site on my work pc.

    yeah a1 contains the lrtn, b1 contains the lookup formula and the other sheet contains the big list of info

    the false option just bangs a n/a in it....

    no idea why but its using the row above what it should be?!

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: vlookup function, picking up the wrong row

    posibly you have spaces after text in either range or lookup cell
    try 1
    =VLOOKUP(TRIM(A1),(B1:C3),2,FALSE)
    or 2
    =VLOOKUP(TRIM(A1)&"*",(B1:C3),2,FALSE)
    if that doesnt work you could try
    =VLOOKUP(TRIM(A1),TRIM(B1:C3),2,FALSE) array entered with ctrl+shift+enter
    Last edited by martindwilson; 03-03-2009 at 10:15 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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