+ Reply to Thread
Results 1 to 6 of 6

VLOOKUP returning an #N/A when it should return a value

  1. #1
    Registered User
    Join Date
    09-30-2011
    Location
    Lithuania
    MS-Off Ver
    Excel 2010
    Posts
    81

    VLOOKUP returning an #N/A when it should return a value

    Hello,

    I have attached a workbook to this post that uses this formula:

    =VLOOKUP(C5,Sheet2!$B$1:$C$99,2,0)

    in Sheet1. The value in C5 is a value produced from another formula. I've carefully checked my work, but I am still getting an error. Can anyone tell me what I am doing wrong? I encounter a similar problem from time to time, and I'm hoping this will help me understand how this formula works a little better. I have a feeling that this has to do either with cell format, or placement of the cell with the formula in relation to the data it is reading.

    Big thanks to anyone who can help at all with this!
    Attached Files Attached Files
    Last edited by Nate Westcott; 12-10-2015 at 05:08 PM.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: VLOOKUP returning an #N/A when it should return a value

    The value in C5 is not EXACTLY 3.1
    It's actually 3.125

    You can see this by formatting C5 to show 3 dedimals.

    Formatting it to show only 1 decimal makes it 'Appear' to be rounded to 3.1, but the actual value 3.125 is still in the cell.
    And your vlookup is using that actual value.

    Also, you referenced the range B1:B99, and specified 2 as the column index.
    There is only 1 column in B1:B99, that should probably be B1:C99

    Try either:
    =VLOOKUP(ROUND(C5,1),VALIDATION!$B$1:$C$99,2,0)

    Or apply the round to the average function in C5
    =ROUND(AVERAGE(L13:L20),1)

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VLOOKUP returning an #N/A when it should return a value

    Hi,

    There are two problems

    1. C5 is an AVERAGE function and returns numbers with decimals e.g. 3.125. This value isn't in your Lookup table. Change C5 to7
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    2. The Lookup range VALIDATION!$B$1:$B$99 is only one column wide, i.e. column B. You are wanting a value from the 2nd column, hence the range should be as wide as your table. i.e. B1:F99
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,457

    Re: VLOOKUP returning an #N/A when it should return a value

    There are two problems: you are trying to return column 2 from a single column array (B1:B99); and you are trying to match a value generated by an AVERAGE calculation against a range of values that doesn't include, for example, 3.125

    This works:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You might want to round your result, ROUND, ROUNDUP, or ROUNDDOWN) and make it an EXACT match (parameter 4 = FALSE)


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: VLOOKUP returning an #N/A when it should return a value

    As an additional thought, instead of rounding, you could change the 4th argument in your VLOOKUP() function to TRUE or 1 (https://support.office.com/en-us/art...8-93a18ad188a1 help file to discuss the different behavior of the 4th argument). This works because your lookup values are sorted in ascending order. The exact choice of solution will probably depend on exactly what you want to happen at your boundary conditions. When the average returns 2.55..., the proposed ROUND() functions will return 2.6, which will cause the VLOOKUP() to return "Very good". My solution will leave the average below 2.6, which means the VLOOKUP() will return "Good". You will need to decide what you want to happen at these boundary conditions.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,457

    Re: VLOOKUP returning an #N/A when it should return a value

    @MrShorty: agreed

+ 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. Vlookup to return multiple rows in return
    By Excelhelpss in forum Excel General
    Replies: 1
    Last Post: 06-18-2015, 09:59 AM
  2. Nested IF Returning False - Need to Return True for Three Scenarios
    By rhelmer in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-18-2015, 05:50 PM
  3. Using vLookup based on results from a vLookup & returning an undetermined list
    By NormalityBan in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 08-14-2014, 05:02 AM
  4. [SOLVED] Return carriage not returning to row under original cell
    By HH61 in forum Excel General
    Replies: 4
    Last Post: 05-07-2014, 02:08 PM
  5. [SOLVED] Formula to always return cell below what a vlookup would return
    By KCHEXCEL in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-28-2013, 12:57 AM
  6. [SOLVED] Why is this formula returning a FALSE result? It should return the value in B13
    By golfpromal in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-20-2012, 05:22 PM
  7. Returning a $ value if a checkbox return true
    By dellie in forum Excel General
    Replies: 3
    Last Post: 02-06-2009, 02:53 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