The LOOKUP function in Google Sheets searches through a row or column for a key and returns the value of a cell in a corresponding result range, at the same relative position where the match was found. It's a simpler, more flexible predecessor to VLOOKUP and HLOOKUP for basic lookup tasks. Dive into our comprehensive guide to master its application.
Parameters
search_key: The value to search for.search_range|search_result_array: Either the one-dimensional range to search, or a two-dimensional array containing both the search range and result range.[result_range]: [Optional] The range containing the values to return, corresponding tosearch_range.
Step-by-Step Tutorial
-
Using
LOOKUPwith separate search and result ranges:- Example: If
A1:A3contains"Red", "Green", "Blue"andB1:B3contains10, 20, 30, then=LOOKUP("Green", A1:A3, B1:B3)will return20.
- Example: If
-
Using
LOOKUPwith a single array:- Example:
=LOOKUP("Blue", A1:B3)will search the first column ofA1:B3and return the corresponding value from the last column.
- Example:
Use Cases and Scenarios
- Simple Value Retrieval: Pull a related value based on a matching key in a sorted list.
- Approximate Matching: Find the closest match when an exact match isn't required, since
LOOKUPassumes sorted data. - Legacy Spreadsheet Support: Maintain compatibility with older spreadsheets that rely on
LOOKUPrather thanVLOOKUPorXLOOKUP.
Related Functions
VLOOKUP: Searches a column for a key and returns a value from a specified column in the same row.XLOOKUP: A more flexible lookup function that supports both rows and columns with customizable match modes.HLOOKUP: Searches a row for a key and returns a value from a specified row in the same column.