+ Reply to Thread
Results 1 to 9 of 9

VLOOKUP problem

  1. #1
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    VLOOKUP problem

    =VLOOKUP($P$3,$A$3:$B$100,2)

    This formula is working but returning a result from 4 cells above the cell which should be returned. Why might this be? Thanks.

    Dan

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: VLOOKUP problem

    Good day,

    Check for duplicate records across the A3:A100 range which match value in P3.

    Show your appreciation - Press the star icon if this post has been helpful

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: VLOOKUP problem

    It returns a result based on the first match it finds. It will not return results from subsequent matches.
    But the fact that you have left out the FALSE (or 0) after the 2 means it will stop at a close match instead of an exact match.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: VLOOKUP problem

    Hi Dan.

    I trust INDEX&MATCH

    =INDEX(B:B,MATCH(P3,A:A,0))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  5. #5
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    839

    Re: VLOOKUP problem

    Hi,

    The VLOOKUP function can take an optional 4th argument that you don't seem to have used, range_lookup, which allows you to specify whether you want Excel to return an approximate or exact match. If you omit it and if there isn't an exact match Excel will return the next largest number.

    To force Excel to return the exact value you require, insert ,FALSE after the 2 in your formula.

    Or, if there is more than 1 exact match in a column, the function will return first one that it encounters "reading" from top to bottom.

    Hope this helps

  6. #6
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Re: VLOOKUP problem

    There aren't any duplicate records in the A3:A100 range. A3:A100 contains text formatted as text. The B3:B100 range contains Numbers formatted as numbers, where duplicates are present.

    However, I have just turned the A3:B100 range into a table and now the correct result is being returned. Why is this?

    To add 'FALSE (or 0) after the 2' would do this: =VLOOKUP($P$3,$A$3:$B$100,2,0) ? Thanks.

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: VLOOKUP problem

    To add 'FALSE (or 0) after the 2' would do this: =VLOOKUP($P$3,$A$3:$B$100,2,0)
    Yes, it tells Excel to find an exact match. If you leave out the 0 (or use a 1) it looks for a close match.

  8. #8
    Forum Contributor
    Join Date
    01-11-2007
    Posts
    127

    Re: VLOOKUP problem

    Sorry, correction - it was my previous sumifs formula that suddenly worked after making the range a table. VLOOKUP still seems to have problems so I have gone with =INDEX(B:B,MATCH(P3,A:A,0)). Thanks Fotis and thanks for everyone else's help.

    Dan

  9. #9
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: VLOOKUP problem

    You are welcome, Dan

    Pls, don't forget to mark your thread as solved!

+ 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