XLOOKUP vs VLOOKUP: Which Excel Function Should You Use?
In this article
XLOOKUP is the modern successor to VLOOKUP, offering a more flexible way to find data in a table because it can look both left and right, defaults to exact matches, and does not require you to count column numbers. While VLOOKUP only searches the leftmost column of a range and returns a value to the right, XLOOKUP allows you to select the lookup array and the return array independently, removing the rigid structure required by its predecessor.
What You'll Need
- A computer with Microsoft Excel installed.
- A version of Excel that supports XLOOKUP (Microsoft 365, Excel 2021, or Excel for the Web). If you are using an older version like Excel 2016 or 2019, you must use VLOOKUP.
- A dataset containing at least two columns: one for the unique identifier (the lookup value) and one for the information you want to retrieve.
Step-by-Step
To understand the difference in practice, follow these steps to implement both functions on the same dataset. Imagine you have a table where Column A contains Employee IDs, Column B contains Names, and Column C contains Departments.
Using VLOOKUP (The Traditional Method)
- Select the cell where you want the result to appear.
- Type
=VLOOKUP(to begin the function. - Click on the cell containing the value you are searching for (e.g., a specific Employee ID in cell E2). This is your lookup_value.
- Type a comma, then highlight the entire table range (e.g., A2:C100). This is the table_array. Note that the Employee ID must be in the first column of this selection.
- Type a comma, then enter the column index number. Since Names are in the second column of your selection, type
2. This is the col_index_num. - Type a comma, then type
FALSEto ensure you get an exact match. This is the range_lookup. - Close the parenthesis
)and press Enter.
Using XLOOKUP (The Modern Method)
- Select the cell where you want the result to appear.
- Type
=XLOOKUP(to begin the function. - Click on the cell containing the value you are searching for (e.g., cell E2). This is the lookup_value.
- Type a comma, then highlight only the column containing the Employee IDs (e.g., A2:A100). This is the lookup_array.
- Type a comma, then highlight only the column containing the Names (e.g., B2:B100). This is the return_array.
- (Optional) Type a comma and enter a message in quotes, such as
"Not Found", to handle errors automatically. This is the if_not_found argument. - Close the parenthesis
)and press Enter.
Comparing the Two in a "Left-Lookup" Scenario
To see where XLOOKUP truly wins, try to find an Employee ID based on a Name. In our table, the Name is in Column B and the ID is in Column A.
- With VLOOKUP: You will find that VLOOKUP cannot do this. Because the ID is to the left of the Name, VLOOKUP cannot "look backward." You would be forced to physically move Column A to the right of Column B or use a complex combination of INDEX and MATCH functions.
- With XLOOKUP: Simply follow the XLOOKUP steps again, but set the lookup_array as Column B (Names) and the return_array as Column A (IDs). XLOOKUP does not care about the physical order of the columns.
Common Mistakes
When using VLOOKUP, the most frequent error is forgetting the FALSE argument at the end. By default, VLOOKUP performs an "Approximate Match," which can return the wrong data if your list isn't sorted alphabetically or numerically. Always specify FALSE for exact matches.
Another common VLOOKUP mistake is inserting a new column into your data table. Because VLOOKUP relies on a static column index number (like 2), adding a column between your lookup column and your result column will shift the data, but the formula will still look at column 2, resulting in the wrong information being returned.
For XLOOKUP, a common mistake is selecting ranges of different sizes. The lookup_array and the return_array must be the same length. If you select A2:A100 for the lookup but B2:B105 for the return, Excel will return a #VALUE! error because the arrays are mismatched.
Tips
Use Absolute References (the dollar signs, like $A$2:$A$100) when you plan to drag your formula down a long list. If you use relative references, the search range will shift down one row for every row you drag the formula, causing it to miss data at the top of your list.
Leverage the if_not_found argument in XLOOKUP to keep your spreadsheets clean. Instead of wrapping your formula in an =IFERROR() function to hide #N/A results, you can build the error message directly into the XLOOKUP formula, reducing the complexity of your syntax.
If you are sharing a workbook with colleagues who use older versions of Excel (Excel 2016 or earlier), avoid XLOOKUP. Since XLOOKUP is a newer feature, users on old versions will see a #NAME? error because their software does not recognize the function. In these specific cases, VLOOKUP is the safer, more compatible choice.
Troubleshooting
If your formula returns #N/A, it means the value you are searching for does not exist in the lookup array. First, check for leading or trailing spaces in your cells. A cell that looks like "101" might actually be "101 " (with a space), which Excel treats as a completely different value. Use the TRIM function to clean your data if this is the case.
If you see a #VALUE! error in XLOOKUP, verify that your two selected ranges are identical in size. If one range is 50 rows and the other is 51, the formula will fail. Ensure both start and end on the same row numbers.
If VLOOKUP is returning the wrong value but not an error, double-check your range_lookup argument. If you left it blank or set it to TRUE, Excel is guessing the closest match. Change this to FALSE to force an exact match.
If you encounter a #NAME? error, you are likely using XLOOKUP in a version of Excel that does not support it. You will need to update your software or rewrite the formula using VLOOKUP or INDEX/MATCH.
Frequently Asked Questions
Is XLOOKUP faster than VLOOKUP?
In most small to medium datasets, the speed difference is negligible. However, XLOOKUP is generally more efficient because it only processes the two specific columns it needs, whereas VLOOKUP processes the entire table array.
Can XLOOKUP return multiple columns at once?
Yes. If you select a return array that spans multiple columns (e.g., B2:D100), XLOOKUP will "spill" the results into adjacent cells, returning all matching data for that row automatically.
Does VLOOKUP work in Google Sheets?
Yes, VLOOKUP is fully supported in Google Sheets. Google Sheets also supports XLOOKUP, making it the preferred choice for most users there as well.
What is the best alternative if I don't have XLOOKUP?
The best alternative is the combination of INDEX and MATCH. This pair of functions mimics XLOOKUP's ability to look left and is more stable than VLOOKUP because it doesn't rely on column index numbers.
Can XLOOKUP search from the bottom up?
Yes. XLOOKUP has an optional search_mode argument. By setting this to -1, you can tell Excel to search from the last item to the first, which is useful for finding the most recent entry in a list.