Google Sheets Lookup Function: VLOOKUP & XLOOKUP Guide
In this article
Google Sheets has several lookup functions, but the one most people mean is VLOOKUP. To use it, type =VLOOKUP(search_key, range, index, [is_sorted]) into a cell, where search_key is the value you want to find, range is the table to search, index is the column number containing the result, and is_sorted is usually FALSE for an exact match. For example, =VLOOKUP("Apple", A2:C10, 3, FALSE) returns the value in column C for the row where column A equals "Apple". If you have a newer sheet, XLOOKUP is more flexible: =XLOOKUP(search_key, search_range, result_range, [missing_value], [match_mode], [search_mode]). This guide walks through both, plus INDEX/MATCH as a fallback.
What You'll Need
- A Google account and access to Google Sheets (desktop browser or the Sheets mobile app).
- A spreadsheet with at least two columns: one containing the values you will search for, and one or more columns containing the data you want to return.
- Basic familiarity with cell references (like A2 or B2:D10).
Step-by-Step
- Open your spreadsheet. Go to sheets.google.com, sign in, and open the file. On mobile, open the Google Sheets app and tap the file. The steps below use the desktop browser; the mobile app has the same functions but the formula bar is accessed by tapping the cell and then the formula icon.
- Identify your lookup column and result column. The lookup column must be the leftmost column in the range you select for VLOOKUP. For example, if you want to find a product name in column A and return its price from column C, your range should start at column A. Write down the column letters and the row numbers of your data (e.g., A2:C100).
- Click an empty cell where you want the result to appear. This is where you will enter the formula.
- Type the VLOOKUP formula. Start with
=VLOOKUP(. Then enter your search key. You can type a literal value in quotes (like"Apple") or reference a cell (likeE2). Add a comma. - Enter the range. Type the range that includes both the lookup column and the result column, for example
A2:C100. Add a comma. Do not include the header row unless you want to search it too; typically start at row 2. - Enter the column index number. This is the number of the column within your range that contains the result, counting from the leftmost column of the range as 1. In the example A2:C100, column A is 1, B is 2, C is 3. So to return the price from column C, type
3. Add a comma. - Enter FALSE for an exact match. Type
FALSE(or0) and close the parenthesis. Your formula should look like=VLOOKUP(E2, A2:C100, 3, FALSE). Press Enter. The result should appear in the cell. - Copy the formula down if you need to look up multiple values. Drag the fill handle (small square at the bottom-right of the cell) down the column. If you want the range to stay fixed, use absolute references with dollar signs:
$A$2:$C$100. - Try XLOOKUP instead (optional but recommended). XLOOKUP is available in Google Sheets and is more flexible because it does not require the lookup column to be leftmost and it handles missing values gracefully. In an empty cell, type
=XLOOKUP(. Enter the search key (e.g.,E2), a comma, the range to search (e.g.,A2:A100), a comma, the range to return (e.g.,C2:C100), a comma, and optionally a value to return if not found (e.g.,"Not found"). Close the parenthesis and press Enter. Example:=XLOOKUP(E2, A2:A100, C2:C100, "Not found"). - Use INDEX and MATCH as an alternative. If you need to look up to the left (return a value from a column left of the lookup column), use
=INDEX(return_range, MATCH(search_key, search_range, 0)). For example,=INDEX(A2:A100, MATCH(E2, C2:C100, 0))finds E2 in column C and returns the corresponding value from column A. The 0 in MATCH means exact match. - Check your results. Verify that the returned values match what you expect by manually checking a few rows. If you see #N/A, the search key was not found. If you see #REF!, the column index is larger than the number of columns in your range.
Common Mistakes
- Forgetting the FALSE argument. If you omit the fourth argument in VLOOKUP, Google Sheets defaults to TRUE (approximate match), which can return wrong results if your data is not sorted. Always use FALSE for exact matches.
- Including the header row in the range. If your range starts at row 1 and row 1 contains headers, VLOOKUP may return the header text or cause mismatches. Start the range at the first data row (e.g., A2).
- Using a column index that is too large. The index counts columns within your selected range, not the sheet's column letters. If your range is B2:D100, column D is index 3, not 4.
- Not locking the range when copying. Without dollar signs, the range shifts as you copy the formula down, causing wrong lookups. Use absolute references like
$A$2:$C$100. - Mismatched data types. If your search key is a number stored as text (or vice versa), VLOOKUP may fail. Ensure both are the same type; you can use
VALUE()orTEXT()to convert. - Trailing spaces. Extra spaces in cells can cause #N/A. Use
TRIM()to clean data or check for spaces.
Tips
- Use XLOOKUP when possible: it is simpler, does not require the lookup column to be first, and lets you specify a not-found value.
- Name your ranges (Data > Named ranges) to make formulas easier to read and maintain.
- Use
IFERRORto handle errors gracefully:=IFERROR(VLOOKUP(...), "Not found"). - For multiple criteria, combine XLOOKUP with concatenation or use
FILTERinstead. - Test your formula on a few rows before filling down the entire column.
Troubleshooting
If your lookup returns #N/A, first check that the search key exists exactly in the lookup column—watch for extra spaces, different capitalization (VLOOKUP is case-insensitive, but XLOOKUP is case-sensitive by default), or number/text mismatches. Use TRIM() and LOWER() to normalize data if needed. If you see #REF!, your column index exceeds the number of columns in your range; recount. If the formula returns the wrong value, confirm you used FALSE for exact match and that the range starts at the correct column. If copying the formula gives shifting results, add dollar signs to lock the range. For XLOOKUP, if you get #VALUE!, check that the search range and return range are the same size. If the function is not recognized, ensure you are using a current version of Google Sheets; XLOOKUP is available in all current versions. As a last resort, re-enter the formula manually or use INDEX/MATCH as a substitute.
Frequently Asked Questions
What is the difference between VLOOKUP and XLOOKUP?
VLOOKUP searches only to the right of the lookup column and requires a column index number. XLOOKUP can search in any direction, uses separate search and return ranges, and allows a default value for not-found cases. XLOOKUP is generally more flexible and less error-prone.
Can I use VLOOKUP to look up to the left?
No, VLOOKUP cannot return values from columns to the left of the lookup column. Use INDEX and MATCH or XLOOKUP instead.
Why does my VLOOKUP return the wrong value?
The most common cause is omitting the FALSE argument, which makes VLOOKUP use approximate match. Also check that the range starts at the correct column and that the column index is correct.
Is VLOOKUP case-sensitive?
No, VLOOKUP is not case-sensitive. XLOOKUP is case-sensitive by default, but you can make it case-insensitive by using LOWER() on both the search key and search range.
How do I handle #N/A errors?
Wrap your formula in IFERROR, for example =IFERROR(VLOOKUP(...), "Not found"). Or use XLOOKUP's fourth argument to specify a not-found value.
Can I use wildcards in VLOOKUP?
Yes, VLOOKUP supports wildcards like * and ? when the search key is text and you use FALSE for exact match. For example, "App*" matches any text starting with "App".