+ Reply to Thread
Results 1 to 8 of 8

VLOOKUP returning "Value Not Available" - tests run, still occuring

  1. #1
    Registered User
    Join Date
    04-22-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    21

    VLOOKUP returning "Value Not Available" - tests run, still occuring

    So as the title suggests I have been having some problems with Vlookup, i stumbled across this thread first

    https://www.excelforum.com/excel-gen...n-vlookup.html

    and ran the tests that way - sadly it's still returning this error and ill be damned if i can figure out what's causing it. To sum up what's been done:

    1) Copied values from original sheet to new sheet as text
    2) Re-written the numbers manually
    3) Performed cell value length, isnumber function - proved true and a match respectively.
    4) Performed IF function to test if the numbers are exact, returned true value (Sheet1;H12)
    5) Performed INDEX/MATCH function on arrays, returned value not available error

    I have attached the spreadsheet to suit. I have this nagging feeling i've made a rookie error. but if anyone could help it would be very much appreciated.

    Junker

  2. #2
    Registered User
    Join Date
    04-22-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    21

    Re: VLOOKUP returning "Value Not Available" - tests run, still occuring

    spreadsheet didnt attach again.
    Attached Files Attached Files

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,474

    Re: VLOOKUP returning "Value Not Available" - tests run, still occuring

    Can I assume the problem is sheet2 column D? 2 observations:

    1) In your MATCH() function, your "lookup_array" argument is a 2D range. This should be a 1D array (since the lookup value is from column C, I am guessing that it is intended to search column B of sheet1).
    2) Again, in the MATCH() function, your "lookup_type" argument is -1, telling the MATCH() function to use a binary search assuming the values in "lookup_array" are sorted in descending order. In your case, the values in column B (assuming that is the column it should be searching in) are sorted in ascending order, so +1 might be a more appropriate choice for the "lookup_type" argument.

    Unless there is more to your question, I think those two corrections should fix the N/A error.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    04-22-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    21

    Re: VLOOKUP returning "Value Not Available" - tests run, still occuring

    Hi MrShorty,

    Thanks for your reply, you're correct about the observations. Honestly i was running the MATCH() function to see if it would return a different value to the VLOOKUP attempt as the INDEX/MATCH combo should have at least returned something. I ran a sample "-1", "0" and "+1" (Row 1,2 & 3) to see if it would perform any differently but after trying with the array change as you suggested but still no luck.

    Not sure as to the relevance but the core data was generated via SQL script/output. For reference this report came from a different database to what i am used to (same core program but the latest version) so I have been trying to see if there was a difference between the current vs. this one.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,474

    Re: VLOOKUP returning "Value Not Available" - tests run, still occuring

    I ran a sample "-1", "0" and "+1" (Row 1,2 & 3) to see if it would perform any differently but after trying with the array change as you suggested but still no luck.
    I am curious what you tried, because those changes "fixed" the N/A error for me. Here's the MATCH() formula I ended up with:
    INDEX(...,MATCH(Sheet2!C2,Sheet1!B2:B108,0)). It returned 21 which appears to be the correct value (in C12).

  6. #6
    Registered User
    Join Date
    04-22-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    21

    Re: VLOOKUP returning "Value Not Available" - tests run, still occuring

    INDEX(Sheet1!C6:C112,MATCH(Sheet2!C6,3,0)) which returned #N/A and

    INDEX(Sheet1!C:C,MATCH(Sheet2!C2,Sheet1!B2:B108,0)) [after your reply] which returned "19" so i have screwed up something stupid. Ill admit my knowledge of INDEX/MATCH functions is limited so i'm trying learn on the fly.

    If i may, what on earth could have caused the recurring error for the VLOOKUP? Far as i can tell it was all pretty standard, but maybe there is a slight formatting error of some kind?

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,474

    Re: VLOOKUP returning "Value Not Available" - tests run, still occuring

    INDEX(Sheet1!C6:C112,MATCH(Sheet2!C6,3,0)) which returned #N/A
    Do you understand why? You asked the MATCH() function to search for the exact value 101 in an array that consists of the one value 3. Because 101 is not exactly equal to 3, the MATCH() function returns N/A.

    INDEX(Sheet1!C:C,MATCH(Sheet2!C2,Sheet1!B2:B108,0)) [after your reply] which returned "19"
    You asked the MATCH() function to look in B2:B108 and find the exact value 101. It searched the array and found 101 in the 11th position. Then you asked it to look at the entire column C (starting in row 1) and find the 11th value in column C, which is 19. Because your "lookup_array" in the MATCH() function is 1 row different from your INDEX() array, your return values will always be one row off. Usually, the INDEX() array and the lookup_array refer to the same rows.
    If i may, what on earth could have caused the recurring error for the VLOOKUP? Far as i can tell it was all pretty standard, but maybe there is a slight formatting error of some kind?
    Without seeing the VLOOKUP() functions you tried, I don't have a good guess why VLOOKUP() did not work. With the correct lookup_table range, it should have worked.

  8. #8
    Registered User
    Join Date
    04-22-2017
    Location
    Australia
    MS-Off Ver
    2016
    Posts
    21

    Re: VLOOKUP returning "Value Not Available" - tests run, still occuring

    I understand now, the first one i mistakenly was interpreting as a column position in the overall array (as if it were VLOOKUP). And with the secondary error, and you're right it worked so THANK YOU SO MUCH!!!

    As far as the reasoning why, this was part of a database migration from similar systems and the output from the database will be used in conjunction with an ancillary programme for reporting. So if there was something i could at least fix, or diagnose then it will save me a lot of headaches down the track.

+ 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. Replies: 1
    Last Post: 03-03-2017, 02:56 PM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. VLOOKUP is returning the "title" of my column in the correct cells.
    By cluelessatwork in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-29-2011, 02:53 PM
  4. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  5. Replies: 4
    Last Post: 02-05-2009, 09:50 AM
  6. Replies: 3
    Last Post: 12-14-2006, 01:36 PM
  7. Leave cell data (IF(ISNA(VLOOKUP) is TRUE instead of returning blank (" ") or #NA
    By joisimha@gmail.com in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-27-2005, 11:05 AM

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