To use the VLOOKUP function in Excel, follow these steps:
-
Understand the VLOOKUP syntax:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
- lookup_value: The value you want to find.
- table_array: The range of cells where the lookup value is located. The lookup value must be in the first column of this range.
- col_index_num: The column number in the table_array from which to return the matching value, counting from the left.
- range_lookup: Optional. Use FALSE for an exact match or TRUE for an approximate match (default is TRUE).
-
Example of usage: Suppose you have a table in cells A2:E21, and you want to find a value based on an ID entered in cell H3. You want to return a value from the second column of the table. The formula would be:
=VLOOKUP(H3, A2:E21, 2, FALSE)
This looks up the value in H3 in the first column of A2:E21 and returns the corresponding value from the second column, requiring an exact match
- Tips for practical use:
- Lock the table range with absolute references (e.g.,
$A$2:$E$21
) to prevent it from changing when copying the formula. - Use relative references for the lookup value (e.g.,
H3
) so it adjusts when copying the formula down rows. - If you want an approximate match, set the last argument to TRUE or omit it, but ensure the first column is sorted ascending.
- For exact matches, use FALSE as the last argument to avoid errors if no exact match is found
- Lock the table range with absolute references (e.g.,
- Summary: VLOOKUP helps you search for a value in the first column of a range and returns a related value from another column in the same row, making it useful for looking up data vertically in tables
This method is widely used for tasks like finding product details by ID, retrieving employee information, or matching data across tables in Excel.