Excel LOOKUP function - syntax and uses
At the most basic level, the LOOKUP function in Excel searches a value in one
column or row and returns a matching value from the same position in another
column or row.
There are two forms of LOOKUP in Excel: Vector and Array. Each form is explained
individually below.
Excel LOOKUP function - vector form
In this context, a vector refers to a one-column or one-row range. Consequently,
you use the vector form of LOOKUP to search one row or one column of data for a
specified value, and pull a value from the same position in another row or column.
The syntax of the vector Lookup is as follows:
LOOKUP(lookup_value, lookup_vector, [result_vector])
Where:
• Lookup_value (required) - a value to search for. It can be a number, text,
logical value of TRUE or FALSE, or a reference to a cell containing the lookup
value.
• Lookup_vector (required) - one-row or one-column range to be searched. It
must be sorted in ascending order.
• Result_vector (optional) - one-row or one-column range from which you
want to return the result - a value in the same position as the lookup
value. Result_vector must be the same size as lookup_range. If omitted, the
result is returned from lookup_vector.
The following examples demonstrate two simple Lookup formulas in action.
Vertical Lookup formula - search in one-column range
Let's say, you have a list of sellers in column D (D2:D5) and the products they sold in
column E (E2:E5). You are creating a dashboard where your users will enter the
seller's name in B2 and you need a formula that would pull a corresponding
product in B3. The task can be easily accomplished with this formula:
=LOOKUP(B2,D2:D5,E2:E5)
To better understand the arguments, please have a look at this screenshot:
Horizontal Lookup formula - search in one-row range
If your source data has a horizontal layout, i.e. the entries reside in rows rather
than columns, then supply a one-row range in
the lookup_vector and result_vector arguments, like this:
=LOOKUP(B2,E1:H1,E2:H2)
In the second part of this tutorial, you will find a few more Excel Lookup examples
that solve more complex tasks. In the meantime, please remember the following
simple facts that will help you bypass possible pitfalls and prevent common errors.