+ Reply to Thread
Results 1 to 4 of 4

VSLOOKUP returns incorrect data

  1. #1
    Registered User
    Join Date
    04-22-2014
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    VSLOOKUP returns incorrect data

    Hello,

    I have a spreadsheet that contains: ID numbers, Athlete Names, Practice scores and averages. I want to use the averages to rank the athletes by highest average. I accomplished this by using the "Large" function without difficulty.

    Now the problem. I want to put the athlete's name next to the average. This seemed simple enough but fails. I am at a loss on how to resolve this.

    Layout
    Column A: Unique ID
    Column B: Athlete name
    Column C-AN: Scores
    Column AO: average score for athlete

    Ranking column
    Cell: D23 formula =LARGE(AO3:AO9,1)
    Cell: D24 formula =LARGE(AO3:AO9,2)
    etc, etc

    Athlete name formula:
    Cell: e23 formula =VLOOKUP(D23,A3:AO9,2,FALSE)
    Cell: e24 formula =VLOOKUP(D24,A3:AO9,2,FALSE)
    etc, etc

    I expected this to show me the athlete name in Column B that corresponds with the score referenced in cell D23. I have tried everything I can think of or find related to vlookup and either get the wrong value returned or #N/A. I have removed the number formatting for the cells.

    Any help would be appreciated. Thanks.
    Last edited by evesdropper; 04-23-2014 at 12:22 AM. Reason: solved

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: VSLOOKUP returns incorrect data

    Hi and welcome to the forum

    vlookup cannot (generally) "look behind" itself, meaning that the column that contains the criteria being searched for, must be the 1st column of the range.

    A way around this is to use the INDEX/Match combo. Something like...
    =index($B$3:$B$9,match(D23,range-containing-averages,0))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    04-22-2014
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: VSLOOKUP returns incorrect data

    FDibbins,

    Thank you! That example does exactly what I was trying to do.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: VSLOOKUP returns incorrect data

    Happy to help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] PivotTable - Code returns incorrect values when using a data connecton
    By efernandes67 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-15-2013, 02:13 PM
  2. [SOLVED] MOD(x,1) returns 1 (*Incorrect*)
    By lokanu in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-18-2012, 10:20 AM
  3. Autosum returns incorrect value
    By CharlCT in forum Excel General
    Replies: 2
    Last Post: 12-14-2008, 07:10 AM
  4. Nested LOOKUP function returns incorrect data
    By TheAkwardOne in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-29-2008, 12:15 AM
  5. [SOLVED] Like with * returns incorrect sheet name
    By marianne in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-23-2006, 10:10 PM

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