Microsoft KB Archive/24659

-

{| The information in this article applies to:
 * width="100%"|


 * Microsoft Excel for Windows, versions 2.x, 3.x, 4.x, 5.0, 5.0c
 * Microsoft Excel for the Macintosh, versions 1.x, 2.2, 3.0, 4.0, 5.0, 5.0a
 * Microsoft Excel for Windows NT, version 5.0
 * Microsoft Excel for Windows 95, version 7.0
 * Microsoft Excel 97 for Windows

SUMMARY
The Microsoft Excel LOOKUP, HLOOKUP, and VLOOKUP functions will return incorrect values if the "lookup_vector" argument is not sorted in ascending order.

Microsoft Excel versions 5.0, 7.0 and 97
"lookup_vector" is the second argument of the LOOKUP function:

LOOKUP(lookup_value,lookup_vector,result_vector) "lookup_vector" is the first row of the table_array (second) argument of the HLOOKUP function: HLOOKUP(lookup_value,table_array,row_index_num,range_lookup) "lookup_vector" is the first column of the table_array (second) argument of the VLOOKUP function: VLOOKUP(lookup_value,table_array,col_index_num,range_lookup) The range_lookup argument which is available for HLOOKUP and VLOOKUP in Microsoft Excel version 5.0, 7.0 and 97 can be used to specify that the lookup table is unsorted by setting range_lookup to FALSE. ARTICLE-ID: \[\[..\/\|Q\]\]

TITLE    : XL2000: Performing a Lookup with Unsorted Data in Excel

Microsoft Excel version 4.0 and earlier
"lookup_vector" is the second argument of the LOOKUP function:

LOOKUP(lookup_value,lookup_vector,result_vector) "lookup_vector" is the first row of the table_array (second) argument of the HLOOKUP function: HLOOKUP(lookup_value,table_array,row_index_num) "lookup_vector" is the first column of the table_array (second) argument of the VLOOKUP function: VLOOKUP(lookup_value,table_array,col_index_num)