Look up a value in a one-column range
=LOOKUP(lookup_value, lookup_vector, [result_vector])
| Parameter | Description |
|---|---|
lookup_value |
The value to search for. |
lookup_vector |
The array or range to search. |
result_vector |
[optional] The array or range to return. |
In the example shown above, the formula in cell F5 returns the value of the match found in column B. Note that result_vector is not provided:
=LOOKUP(F4,B5:B9) // returns match in level
The formula in cell F6 returns the corresponding Tier value from column C. Notice in this case, both lookup_vector and result_vector are provided:
=LOOKUP(F4,B5:B9,C5:C9) // returns corresponding tier
LOOKUP can be used to get the value of the last filled (non-empty) cell in a column. In the screen below, the formula in F6 is:
=LOOKUP(2,1/(B:B<>""),B:B)
Like the above example, the lookup function can be used to look up the latest price in data sorted in ascending order by date. In the screen below, th
=LOOKUP(2,1/(item=F5),price)
The LOOKUP function has an array form as well. In the array configuration, LOOKUP takes just two arguments: the lookup_value, and a single two-dimensi
LOOKUP(lookup_value, array) // array form
In the array form, LOOKUP evaluates the array and automatically changes behavior based on the array dimensions. If the array is wider than tall, LOOKU
=LOOKUP(E5,B5:C9) // vertical array
=LOOKUP(E6,C11:G12) // horizontal array