Microsoft KB Archive/87442

= VLOOKUP/HLOOKUP Return Incorrect Value with TFE or AEE =

Article ID: 87442

Article Last Modified on 11/16/2006

-

APPLIES TO


 * Microsoft Excel 97 Standard Edition
 * Microsoft Excel 95 Standard Edition
 * Microsoft Excel 5.0 Standard Edition
 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q87442





SYMPTOMS
In Microsoft Excel, when you use the VLOOKUP and HLOOKUP functions, the incorrect value or #VALUE error message is returned if Transition Formula Evaluation (TFE) (Excel version 5.0 or later) or Alternate Expression Evaluation (AEE) is selected (Excel version 4.0).



CAUSE
VLOOKUP and HLOOKUP return the index in the lookup array instead of the value at that index if TFE or AEE is selected and the col_index_num (row_index_num for HLOOKUP) argument is set to 1.



WORKAROUND
To return the correct value when you use the VLOOKUP or HLOOKUP function, disable TFE or AEE by using one of the following methods.

Microsoft Excel Versions 5.0 and Later
To disable Transition Formula Evaluation, follow these steps:


 * 1) On the Tools menu, click Options (or Preferences). Click the Transition tab.
 * 2) Under Sheet Options, clear the Transition Formula Evaluation check box, and click OK.

Microsoft Excel Version 4.0
To disable Alternate Expression Evaluation, follow these steps:


 * 1) On the Options menu, click Calculation.
 * 2) Under Sheet Options, clear the Alternate Expression Evaluation check box and click OK.



MORE INFORMATION
Transition Formula Evaluation and Alternate Expression Evaluation are options designed to allow for differences between the way Microsoft Excel and Lotus 1-2-3 evaluate expressions. This option is automatically enabled when you open a Lotus 1-2-3 worksheet in Microsoft Excel.

The VLOOKUP and HLOOKUP functions search the first column of an array (top row with HLOOKUP) for a particular value and return the value in the cell indicated by the index argument. However, these functions may return the incorrect value if TFE or AEE is enabled.

Example
To use this example, enter the following data:

  A1: Blue   B1: 10 A2: Green B2: 20 A3: Red   B3: 30

The formula =VLOOKUP(&quot;Blue&quot;,A1:B3,1) returns the value 0 (array index to cell A1) if TFE or AEE is enabled and the value &quot;Blue&quot; if TFE or AEE is not enabled.

NOTE: Array indexes start with 0 so the index to A1 is 0, A2 is 1, and so on.

