LOOKUP
TheLOOKUP
formula searches for a value in a range or array and returns a corresponding value from a specified result range. This formula is commonly used to search for a specific value in a table and return a related value, such as looking up a product code and returning the corresponding price.
- How to use
LOOKUP
formula? - Examples of using
LOOKUP
formula LOOKUP
formula not working?- Similar formulas to
LOOKUP
Usage
Use the LOOKUP
formula with the syntax shown below, it has 2 required parameters and 1 optional parameter:
- search_key (required):
The value to search for in the search range or array. - search_range|search_result_array (required):
The range or array to search in. This can be either a range of cells or an array of values. - result_range (optional):
The range of cells containing the values to return. If this parameter is not specified, the formula will return the corresponding value from the search range or array.
Examples
Here are a few example use cases that explain how to use theLOOKUP
formula in Google Sheets.
Lookup and return a value from a table
Using the LOOKUP
formula, you can search for a specific value in a table and return a related value, such as looking up a product code and returning the corresponding price.
Find the last value in a range
By using LOOKUP
with a search key that is greater than any value in the search range, you can find the last value in the range.
Return multiple values from a table
By using LOOKUP
in combination with other formulas, such as INDEX
, you can return multiple values from a table based on a single search key.
Common Mistakes
LOOKUP
not working? Here are some common mistakes people make when using the LOOKUP
Google Sheets Formula:
Not sorting the search range
LOOKUP requires the search range to be sorted in ascending order. If the search range is not sorted, the formula may return incorrect results. To fix this mistake, sort the search range in ascending order.
Providing incorrect search_key
If the search_key is not an exact match for any value in the search_range, LOOKUP returns the closest match that is less than the search_key. If the search_key is not in the search_range and there is no smaller value, LOOKUP returns an error. To fix this mistake, check that the search_key is spelled correctly and is in the correct format.
Not specifying a result_range
If the result_range is not specified, LOOKUP returns the value in the corresponding position of the search_range. This may not always be the desired result. To fix this mistake, specify a result_range.
Using a range that includes empty cells
If the search_range or result_range includes empty cells, LOOKUP may return incorrect results. To fix this mistake, ensure that the search_range and result_range only include cells containing data.
Using LOOKUP with multiple search keys
LOOKUP can only be used to search for a single value at a time. If you need to search for multiple values, use a different formula such as VLOOKUP or HLOOKUP. To fix this mistake, use a different formula or search for one value at a time.
Related Formulas
The following functions are similar to LOOKUP
or are often used with it in a formula:
-
VLOOKUP
The
VLOOKUP
function is a lookup formula used to search for a value in the first column of a range of cells (the search key) and return a value in the same row from a specified column in that range. This function is most commonly used to look up and retrieve data from a table. -
HLOOKUP
The
HLOOKUP
function is a lookup formula that searches for a key in the top row of a table and returns the value in the same column for a specified row. This function is commonly used to extract data from a table based on a specific criteria. -
INDEX
The
INDEX
formula in Google Sheets is used to return a value or reference of a cell at the intersection of a specified row and column in a given range. The formula is commonly used to lookup and retrieve values from a table or range of cells. -
MATCH
The
MATCH
formula is used to search for a specified value within a range and returns the relative position of the value within the range. This formula is commonly used in conjunction with theINDEX
formula to retrieve a value from a specific cell in a range. Thesearch_type
parameter is optional and determines the type of match to be performed, such as exact match, less than, or greater than.
Learn More
You can learn more about the LOOKUP
Google Sheets function on Google Support.