Category: FUNCTION | Updated: 2026-11-20

How to Use the VLOOKUP Function in Google Sheets | Search a Table Vertically for Matching Data

How to Use the VLOOKUP Function

The VLOOKUP function searches for a key in the leftmost column of a specified range and returns the value in a specified column number from the matching row. It is widely used for linking tables, such as looking up unit prices from a product master table.

Syntax

=VLOOKUP(search_key, range, index, [is_sorted])
  • search_key: The value or cell reference to search for (required).
  • range: The entire table to search. Make sure the column containing search_key is the leftmost column of this range (required).
  • index: The column number (counting from 1 as the leftmost column of range) from which to return a value (required).
  • is_sorted: Specify FALSE (or 0) for an exact match, or TRUE (or 1) for an approximate match (optional, though explicitly setting FALSE is recommended).

Table Example

Here is an example of automatically retrieving the "Product Name" into Column B based on the "Product ID" in Column A from the "Product Master" in Columns D–E.

Row Column A (Product ID) Column B (Product Name) Column C Column D (Master ID) Column E (Master Product Name)
1 Product ID Product Name Master ID Master Product Name
2 P002 =VLOOKUP(A2, $D$2:$E$4, 2, FALSE) P001 Wireless Mouse
3 P003 =VLOOKUP(A3, $D$2:$E$4, 2, FALSE) P002 Mechanical Keyboard
4 P001 =VLOOKUP(A4, $D$2:$E$4, 2, FALSE) P003 4K Monitor
  • Row 2 formula: =VLOOKUP(A2, $D$2:$E$4, 2, FALSE) → Result: Mechanical Keyboard
  • Row 3 formula: =VLOOKUP(A3, $D$2:$E$4, 2, FALSE) → Result: 4K Monitor

Tip: Use an absolute reference like $D$2:$E$4 so the lookup range does not shift when copying the formula down to other rows.

Common Errors and Notes

  • Search key not found (#N/A error): An #N/A error occurs if search_key does not exist in the leftmost column of the master table, if there are extra leading or trailing spaces, or if data types differ (such as the number 100 vs. the text "100"). Wrap the formula in IFERROR if you want to display a blank cell or "Not Found" when no match is found.
  • Out-of-bounds index (#REF! error): If you specify a column index larger than the number of columns in range, a #REF! error occurs.
  • Formulas breaking when columns are inserted or deleted: Inserting a column inside the master table does not automatically update the hardcoded index number, causing the wrong column to be returned. Use XLOOKUP if you want formulas that remain resilient to column insertions.

Frequently Asked Questions

Q. What should I specify for the 4th argument (is_sorted) of VLOOKUP?

A. When searching for an exact match such as a product code or employee ID, always specify "FALSE" (or "0"). If omitted, it defaults to "TRUE (approximate match)", which can return unintended values.

Q. Can VLOOKUP retrieve values from a column to the left of the search key?

A. No, VLOOKUP searches the "leftmost column" of the specified range and can only return values from columns to its right. To retrieve values from a column to the left, use XLOOKUP or a combination of INDEX and MATCH.