Which function is best used to lookup and retrieve data from a specific row in a table?

Looks through a sorted row or column for a key and returns the value of the cell in a result range located in the same position as the search row or column.

Sample Usage

LOOKUP(10003, A1:A100, B1:B100)

LOOKUP(10003, A1:B100)

LOOKUP("foo", A1:Z10)

Syntax

LOOKUP(search_key, search_range|search_result_array, [result_range])

  • search_key - The value to search for in the row or column. For example, 42, "Cats", or I24.
  • search_range|search_result_array - One method of using LOOKUP is to provide a single row or column search_range to look through for the search with a second argument result_range. The other way is to combine these two arguments into one search_result_array where the first row or column is searched and a value is returned from the last row or column in the array.
  • result_range - [ OPTIONAL ] - The range from which to return a result. The value returned corresponds to the location where search_key is found in search_range. This range must be only a single row or column and should not be used if using the search_result_array method.

Notes

The LOOKUP function will only work properly if data in search_range or search_result_array is sorted. Use VLOOKUP, HLOOKUP, or other related functions if data is not sorted.

If search_key is not found, the item used in the lookup will be the value that’s immediately smaller in the range provided. For example, if the data set contains the numbers 1, 3, 5 and search_key is 2, then 1 will be used for the lookup.

In the search_result_array method, the last row or column in the provided range is returned. If a different row or column is desired, use VLOOKUP or HLOOKUP instead.

When using the search_result_array method, if the range provided contains more columns than rows, then the search will be from left to right over the first row in the range. If the range contains an equal number of rows and columns or more rows than columns, then the search will be from top to bottom over the first column in the range.

Examples

This examples shows the price of part number 126.

Part Number Price Formula Result
105 $27.50 =LOOKUP(126, $A$2:$A$6, $B$2:$B$6) $33.00
126 $33.00    
133 $41.75    
171 $26.75    
188 $32.99    

This examples shows when the search_key is not found (student ID 765333), a non-exact match may be returned.

Part Number Price Formula Result
764541 B =LOOKUP(765333,$A$2:$A$5,$B$2:$B$5) C
764598 C    
765444 B-    
766765 A    

See Also

VLOOKUP: Vertical lookup. Searches down the first column of a range for a key and returns the value of a specified cell in the row found.

HLOOKUP: Horizontal lookup. Searches across the first row of a range for a key and returns the value of a specified cell in the column found.

MATCH: Returns the relative position of an item in a range that matches a specified value.

Was this helpful?

How can we improve it?

Learning Outcomes

  • Use lookup functions and formulas

Lookup functions in Excel are used for looking through a single column or row to find a particular value from the same place in a second column or row. This often takes place when there are multiple worksheets within a workbook or a large amount of data in a worksheet. Lookup functions are very helpful with large sets of data to find specific information across many rows or columns.

VLOOKUP (Vertical Lookup)

Looks for a value in the leftmost column of a table and returns a value in the same row from the vertical column you define. The lookup value must always be in the leftmost column of the table.

The Excel formula is written =VLOOKUP(lookup_value,table_array,col_index_num,[range_lookup])

This table includes the sales totals for salespeople. In this case you want to find out what the sales were for certain salespeople. This is a small example but imagine a long list of names and numbers to search through. Using the VLOOKUP function quickly brings you the results you want. Be sure to use F4 to create the absolute references and keep the table array the same for each lookup. Also make sure and make the col_index_num use the second column in the table (column 2 in the table) with a return for the range_lookup as FALSE. By using FALSE in all cases, there is no need to sort your tables into ascending order. Here is what those results look like.

Which function is best used to lookup and retrieve data from a specific row in a table?
 
Which function is best used to lookup and retrieve data from a specific row in a table?

For another VLOOKUP example, watch this video of how to use this function to find parts that are in stock and the supplier for particular parts.

HLOOKUP (Horizontal Lookup)

Looks for a value in the topmost row of a table and returns a value in the same row from the horizontal column you define. The lookup value must always be in the leftmost column of the table.

The Excel formula is written =HLOOKUP(lookup_value,table_array,row_index_num,[range_lookup])

MATCH and INDEX Functions

Now we’ll learn two additional lookup functions, Match and Index. Watch this video to learn how to use Match and Index lookup functions. Here are the descriptions and formulas for creating them in Excel.

  • MATCH – Function that returns a position of a value in a range which can be a row, column or table. The Excel formula is written =MATCH(lookup_value,lookup_array,[match_type])
  • INDEX – Function that returns a position of a value in a range which looks at the intersection of a column and row position in a table. The Excel formula is written =INDEX(reference,row_num,[column_num],[area_num])

As you become more familiar with lookup functions, try out a few more by selecting the Formulas tab, Lookup & Reference button and see what others are available for you to try.

Which function is best used to lookup and retrieve data from a specific row in a table?

PRactice Questions

Contribute!

Did you have an idea for improving this content? We’d love your input.

Improve this pageLearn More

Which function is best used to LOOKUP and retrieve data from a specific row in a table match address VLOOKUP Hlookup?

HLOOKUP performs the same function as VLOOKUP, but looks up data that has been formatted by rows. HLOOKUP searches for a value in the top row of a table (or an array of values), and then returns a value in the same column from a row you specify in the table or array.

Which function is used to retrieve data from a specific row in a table?

The VLOOKUP or Vertical Lookup function is used when data is listed in columns. This function searches for a value in the left-most column and matches it with data in a specified column in the same row. You can use VLOOKUP to find data in a sorted or unsorted table.

Which function is used to LOOKUP and retrieve data?

Well, a lookup function will help you find values in a table of data and insert them in another worksheet location. The syntax for a lookup function-- this is the HLOOKUP, and it's very similar to the VLOOKUP. The only change is our third argument is row index number instead of column index number.

What is the best LOOKUP function in Excel?

Excel's Best Lookup Method: INDEX-MATCH lookup_value—The value to match in lookup_array. lookup_array—A range of cells with data. match_type—Specifies how Excel matches the lookup_value with values in the lookup_array. For exact matches, always use 0 for this argument.