Master XLOOKUP in Google Sheets for Data Lookup: Easy Guide with Examples
GSheetLab Expert
Author
2026-05-12
Published
Learn how to use XLOOKUP in Google Sheets to simplify data searches. Replace older lookup functions like VLOOKUP with this powerful, flexible, and beginner-friendly guide.
Looking up data is one of the most critical tasks in any spreadsheet. Whether you're managing customer records, inventory systems, or sales reports, finding specific information quickly is essential. While VLOOKUP and HLOOKUP have been the standard for years, XLOOKUP is the modern, more powerful alternative that makes data retrieval faster and more accurate.
What Is XLOOKUP in Google Sheets?
XLOOKUP is a versatile function designed to find a value in a range and return a matching value from another range. It effectively replaces VLOOKUP, HLOOKUP, and the standard LOOKUP function by being more flexible and easier to use.
- Search both vertically and horizontally
- Returns exact matches by default
- Works in any direction (left or right)
- Built-in error handling for missing values
XLOOKUP Formula Syntax
The syntax for XLOOKUP is straightforward, eliminating the need to count column indices manually:
=XLOOKUP(search_key, lookup_range, result_range, [if_not_found])- search_key: The value you are looking for.
- lookup_range: The range where the search_key is located.
- result_range: The range containing the value you want to return.
- if_not_found: (Optional) A custom message if no match is found.
Basic Example: Finding Employee Data
Imagine you have a table of employees with IDs in column A, Names in column B, and Departments in column C.
| ID | Name | Department |
|---|---|---|
| 101 | Ali | IT |
| 102 | Sara | HR |
| 103 | Ahmed | Finance |
To find the name of the employee with ID 102, you would use:
=XLOOKUP(102, A2:A4, B2:B4)This returns **Sara** without needing to worry about which column number 'Name' is.
Why XLOOKUP is Better Than VLOOKUP
- No Column Index: You don't have to count '1, 2, 3' to find your data.
- Look Left: XLOOKUP can find data to the left of your search column, which VLOOKUP cannot do without complex workarounds.
- Exact Match Default: VLOOKUP defaults to approximate match, which often causes errors. XLOOKUP defaults to exact match.
- Graceful Errors: Use the [if_not_found] argument to show 'Not Found' instead of an ugly #N/A error.
Advanced Tips for XLOOKUP
Using Wildcards
You can use '*' for multiple characters or '?' for a single character to perform partial searches. For example, to find the first name starting with 'Ah':
=XLOOKUP("Ah*", B2:B4, C2:C4)Horizontal Lookups
XLOOKUP works just as well across rows as it does down columns. Simply provide horizontal ranges (e.g., A1:Z1) instead of vertical ones.
Comparison Table
| Feature | VLOOKUP | XLOOKUP |
|---|---|---|
| Direction | Left to Right Only | Any Direction |
| Ease of Use | Medium (Requires index) | Easy (Direct Range) |
| Default Match | Approximate | Exact |
| Error Handling | Requires IFERROR | Built-in |
XLOOKUP is a game-changer for Google Sheets users. It simplifies your formulas, reduces errors, and handles modern data workflows with ease. If you haven't switched from VLOOKUP yet, today is the day!
Did you find this helpful? Share it with your team.