Microsoft KB Archive/24659: Difference between revisions

From BetaArchive Wiki
m (Text replacement - "\[\[..\/URJump\|Q\d{5,6}\]\]" to "\[\[..\/$1\|Q$1\]\]")
m (Text replacement - """ to """)
 
Line 25: Line 25:
== SUMMARY ==
== SUMMARY ==


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


== MORE INFORMATION ==
== MORE INFORMATION ==
Line 31: Line 31:
=== Microsoft Excel versions 5.0, 7.0 and 97 ===
=== Microsoft Excel versions 5.0, 7.0 and 97 ===


"lookup_vector" is the second argument of the LOOKUP function:
"lookup_vector" is the second argument of the LOOKUP function:


<pre>  LOOKUP(lookup_value,lookup_vector,result_vector)
<pre>  LOOKUP(lookup_value,lookup_vector,result_vector)
</pre>
</pre>
&quot;lookup_vector&quot; is the first row of the table_array (second) argument of the HLOOKUP function:
"lookup_vector" is the first row of the table_array (second) argument of the HLOOKUP function:
<pre>  HLOOKUP(lookup_value,table_array,row_index_num,range_lookup)
<pre>  HLOOKUP(lookup_value,table_array,row_index_num,range_lookup)
</pre>
</pre>
&quot;lookup_vector&quot; is the first column of the table_array (second) argument of the VLOOKUP function:
"lookup_vector" is the first column of the table_array (second) argument of the VLOOKUP function:
<pre>  VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)
<pre>  VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)
</pre>
</pre>
Line 48: Line 48:
=== Microsoft Excel version 4.0 and earlier ===
=== Microsoft Excel version 4.0 and earlier ===


&quot;lookup_vector&quot; is the second argument of the LOOKUP function:
"lookup_vector" is the second argument of the LOOKUP function:


<pre>  LOOKUP(lookup_value,lookup_vector,result_vector)
<pre>  LOOKUP(lookup_value,lookup_vector,result_vector)
</pre>
</pre>
&quot;lookup_vector&quot; is the first row of the table_array (second) argument of the HLOOKUP function:
"lookup_vector" is the first row of the table_array (second) argument of the HLOOKUP function:
<pre>  HLOOKUP(lookup_value,table_array,row_index_num)
<pre>  HLOOKUP(lookup_value,table_array,row_index_num)
</pre>
</pre>
&quot;lookup_vector&quot; is the first column of the table_array (second) argument of the VLOOKUP function:
"lookup_vector" is the first column of the table_array (second) argument of the VLOOKUP function:
<pre>  VLOOKUP(lookup_value,table_array,col_index_num)
<pre>  VLOOKUP(lookup_value,table_array,col_index_num)


Line 61: Line 61:
== REFERENCES ==
== REFERENCES ==


&quot;Microsoft Excel Function Reference,&quot; version 4.0, pages 221-222, 264-265, 450-451
"Microsoft Excel Function Reference," version 4.0, pages 221-222, 264-265, 450-451


&quot;Microsoft Excel Function Reference,&quot; version 3.0, pages 123, 145-146, 246-247
"Microsoft Excel Function Reference," version 3.0, pages 123, 145-146, 246-247


&quot;Microsoft Excel Functions and Macros,&quot; version 2.2, pages 41-42, 55-56
"Microsoft Excel Functions and Macros," version 2.2, pages 41-42, 55-56
|}
|}


Line 80: Line 80:
<br />
<br />
<br />
<br />
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
</blockquote>
</blockquote>
|}
|}

Latest revision as of 13:50, 21 July 2020



Excel: LOOKUP, HLOOKUP, VLOOKUP Return Incorrect Values

Last reviewed: December 15, 1998
Article ID: Q24659



The information in this article applies to:

  • 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.

MORE INFORMATION

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)

REFERENCES

"Microsoft Excel Function Reference," version 4.0, pages 221-222, 264-265, 450-451

"Microsoft Excel Function Reference," version 3.0, pages 123, 145-146, 246-247

"Microsoft Excel Functions and Macros," version 2.2, pages 41-42, 55-56



KBCategory: kbusage

KBSubcategory:

Additional reference words: 7.00 1.0 1.00 1.03 1.04 1.06 1.5 1.50 2.0
2.00 2.01 2.1 2.10 2.2 2.20 3.0 3.00 4.0 4.00 5.00 97


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 15, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.