Microsoft Office Tutorials and References
In Depth Information
Figure 12.31. The quirky
The quirky LOOKUP
LOOKUP function decided to do a
function decided to do a VLOOKUP
HLOOKUP, depending on the shape of the lookup array.
, depending on the shape of the lookup array.
In addition, LOOKUP always performs a range lookup, similar to leaving
off the FALSE as the fourth parameter of VLOOKUP or HLOOKUP. For this
reason, your lookup array must always be sorted.
If you do not want to return a value from the last column of the array, you
can specify two vectors in the alternative form of the syntax discussed in
the next section.
LOOKUP(lookup_value, lookup_vector, result_vector)
In this version of the LOOKUP function, you specify vectors that are either
one row tall or one column wide. This version enables you to do a lookup
similar to VLOOKUP where the result field is to the left of the key field. It
also enables you to perform the mythical VHLOOKUP,where you look up a
value in a vertical vector and get the result from a horizontal vector. In
cell C4 of Figure 12.31 , the result vector E7:H7 is horizontal whereas the
lookup vector E2:E5 is vertical.
One additional super-power of the old LOOKUP function is the ability to
look up several values at once. You have to use Ctrl+Shift+Enter to accept
the formula, and because LOOKUP will be returning an array of answers,