Sub topic 13
Choosing Between VLOOKUP and XLOOKUP in Google Sheets
Assume you know how to enter formulas, use cell and range references, write absolute references such as $A$2:$C$100, and reference another sheet. This chapter helps you choose the lookup function that fits the job.
Start with the shape of the task
A lookup uses a key to find a row and then returns related data from that row. For example, a product code in E2 can find the product price in column C.
Use VLOOKUP when the lookup key is in the first column of one rectangular table and you want a simple, familiar formula:
=VLOOKUP(E2, A2:C100, 3, FALSE)This searches column A, finds the exact value from E2, and returns the value from the third column of the selected range.
Use XLOOKUP when you want the lookup range and result range to be independent:
=XLOOKUP(E2, A2:A100, C2:C100, "Not found")This searches A2:A100 and returns the value at the same position in C2:C100.
Compare the functions
| Task | VLOOKUP | XLOOKUP |
|---|---|---|
| Exact match | Add `FALSE` as the last argument | Exact match is the default |
| Return a value to the left | Not directly | Yes |
| Custom missing-value message | Usually wrap with `IFNA` | Use the fourth argument |
| Search from the bottom | Not directly | Use search mode `-1` |
| Return several columns | Limited and less direct | Return a multi-column result range |
| Approximate match | Useful with sorted tables | Supports several match modes |
Prefer VLOOKUP for simple, established tables
VLOOKUP is a reasonable choice when the table already has the key in its first column and the formula is widely understood by your team. Always specify FALSE for an exact lookup unless you deliberately need approximate matching.
=VLOOKUP("P-102", A2:C100, 3, FALSE)VLOOKUP's approximate mode uses TRUE, or its omitted default. It expects the first column of the range to be sorted in ascending order. It returns the row with the largest key that is less than or equal to the search key. This works well for tiers such as shipping rates or commission bands.
The default can cause incorrect results when a list is unsorted or when you expected an exact match. For product codes, employee IDs, and invoice numbers, use FALSE.
Prefer XLOOKUP for flexible formulas
XLOOKUP separates the search range from the result range. That makes the formula easier to read and avoids counting columns.
It can also look to the left:
=XLOOKUP(E2, C2:C100, A2:A100, "Not found")This searches product names in column C and returns product codes from column A.
XLOOKUP makes common decisions explicit:
- Use
"Not found"as themissing_valueargument when a missing key is an expected situation. - Use match mode
-1for an exact match or the next smaller item. - Use match mode
1for an exact match or the next larger item. - Use match mode
2when the key contains wildcards such as*. - Use search mode
-1to return the last match instead of the first.
For example, this returns the last recorded price for a repeated product code:
=XLOOKUP(E2, A2:A100, C2:C100, "Not found", 0, -1)The 0 requests an exact match. The final -1 searches from the bottom upward.
Use the decision path
A practical rule
Choose VLOOKUP when compatibility and simplicity matter more than flexibility. Choose XLOOKUP for new formulas when you need separate ranges, readable missing-value handling, left lookups, custom match modes, reverse searches, or several returned columns.
For either function, keep the source ranges stable with absolute references when copying formulas:
=XLOOKUP(A2, Products!$A$2:$A$100, Products!$C$2:$C$100, "Not found")Exercise
Which function should you choose to find an exact product code in column A and return the price from column C, while displaying "Missing" if the code is absent?
Show answer
Use =XLOOKUP(E2, A2:A100, C2:C100, "Missing"). A VLOOKUP alternative is =IFNA(VLOOKUP(E2, A2:C100, 3, FALSE), "Missing").