Google Sheets does not have a function named XLOOKUP. The closest equivalent is XLOOKUP in Microsoft Excel, but in Google Sheets you use INDEX and MATCH together, or the newer XLOOKUP function if you are using a connected spreadsheet that syncs with Excel. For a direct replacement, use =INDEX(return_range, MATCH(search_key, search_range, 0)).
What XLOOKUP Does in Excel
XLOOKUP, introduced in Excel 2021 and Microsoft 365, searches a range for a key and returns a matching value from another range. Unlike VLOOKUP, it can look to the left, return multiple values, and handle missing values with a custom message. Its syntax is:
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
For example, with product names in A2:A10 and prices in B2:B10, =XLOOKUP("Widget", A2:A10, B2:B10) returns the price of Widget. If not found, it returns #N/A unless you supply a fourth argument like "Not found".
Why Google Sheets Doesn’t Have XLOOKUP
Google Sheets has its own function library, and it does not include XLOOKUP as of 2025. Instead, Google offers VLOOKUP, HLOOKUP, and INDEX/MATCH. However, Google Sheets supports the new XLOOKUP function when you open an Excel file that contains it, but it is not a native function you can type in a blank Google Sheet. If you try to type =XLOOKUP in a Google Sheets cell, you’ll get a #NAME? error because the function is not recognized.
How to Replicate XLOOKUP in Google Sheets
The most common replacement is INDEX/MATCH. Suppose you have a list of employee IDs in column A (A2:A100) and names in column B (B2:B100). To find the name for ID 102, use:
=INDEX(B2:B100, MATCH(102, A2:A100, 0))
This works like XLOOKUP: MATCH finds the row number where 102 appears in A2:A100 (exact match, 0), and INDEX returns the corresponding value from B2:B100.
For a left lookup (returning a value to the left of the search column), INDEX/MATCH handles it naturally. For example, with IDs in B and names in A, use =INDEX(A2:A100, MATCH(102, B2:B100, 0)).
If you need a default value when not found, wrap in IFERROR:
=IFERROR(INDEX(B2:B100, MATCH(102, A2:A100, 0)), "Not found")
Choosing Between VLOOKUP, HLOOKUP, INDEX/MATCH, and XLOOKUP
In Google Sheets, your choice depends on your data layout:
- VLOOKUP: Use when the lookup value is in the leftmost column of the table and you want a value to the right. It works but cannot look left.
- HLOOKUP: Use for horizontal data (rows instead of columns). Rarely needed.
- INDEX/MATCH: Most flexible. Works for left lookups, right lookups, and even two-way lookups when combined with MATCH twice.
- XLOOKUP (Excel only): If you are working in Excel, XLOOKUP is simpler and more powerful. In Google Sheets, you can use the
XLOOKUPfunction only if you have an Excel file synced via Office Editing for Docs, but it is not native.
For most Google Sheets users, INDEX/MATCH is the best replacement because it is fast and works in all versions.
Common Problems and Mistakes
When using INDEX/MATCH in Google Sheets, watch out for these issues:
- Mismatched range sizes: The lookup array and return array must be the same size. If A2:A100 and B2:B100, both are 99 rows. If you use A2:A100 and B2:B99, you’ll get a #VALUE! error.
- Exact match vs. approximate: Use 0 for exact match. If you omit it, MATCH defaults to 1 (approximate), which requires sorted data and can give wrong results.
- Text vs. numbers: If you search for a number but the lookup column contains text-formatted numbers, MATCH may fail. Use
=INDEX(...)withVALUE()or ensure consistent formatting. - Case sensitivity: MATCH is case-insensitive by default. If you need case-sensitive, use
EXACTin an array formula, but that’s advanced. - Duplicate values: MATCH returns the first match, not the last. If duplicates exist, you may need to sort or use FILTER.
Using XLOOKUP in Excel vs. Google Sheets
If you are migrating from Excel to Google Sheets, you might be used to XLOOKUP. Here’s a quick comparison:
| Feature | Excel XLOOKUP | Google Sheets INDEX/MATCH |
|---|---|---|
| Syntax | Single function | Two functions nested |
| Left lookup | Yes | Yes |
| Default if not found | Yes (4th argument) | Use IFERROR |
| Multiple return values | Yes (returns array) | Use FILTER or ARRAYFORMULA |
| Wildcard support | Yes (match_mode 2) | Not directly; use REGEXMATCH or FILTER |
For most basic lookups, INDEX/MATCH is sufficient. For complex scenarios like returning multiple matches, Google Sheets offers FILTER which is often simpler than XLOOKUP’s array capabilities.
Alternatives to XLOOKUP in Google Sheets
Beyond INDEX/MATCH, consider these Google Sheets functions:
- FILTER: Returns all matching rows. For example,
=FILTER(B2:B100, A2:A100=102)returns all names for ID 102. - VLOOKUP with IFERROR: Simple but limited.
- QUERY: Powerful SQL-like syntax. For example,
=QUERY(A1:B100, "select B where A = 102", 0)returns matching names. - XLOOKUP via Google Sheets API: Not available as a function, but you can import an Excel file that uses XLOOKUP and it will calculate.
Frequently Asked Questions
Can I type =XLOOKUP in Google Sheets? No. Google Sheets does not recognize XLOOKUP as a function name. You’ll get a #NAME? error. Use INDEX/MATCH instead.
Is XLOOKUP faster than VLOOKUP in Google Sheets? Since XLOOKUP isn’t available, the question is moot. In Excel, XLOOKUP is generally faster than VLOOKUP, but in Google Sheets, INDEX/MATCH is comparable in speed.
How do I do a left lookup in Google Sheets? Use INDEX/MATCH. For example, to return a value from column A based on a match in column B, use =INDEX(A2:A100, MATCH("key", B2:B100, 0)).
What is the closest Google Sheets function to XLOOKUP? The closest is INDEX/MATCH combined. It offers the same flexibility for exact matches and left lookups. For multiple matches, use FILTER.
Does Google Sheets have a function called XLOOKUP in 2025? No. As of this writing, it is not a native function. However, if you open an Excel file that contains XLOOKUP formulas, Google Sheets will calculate them because it supports the function for compatibility, but you cannot create new ones.
Can I use XLOOKUP in Google Sheets with an add-on? No standard add-on adds XLOOKUP. You can create a custom function using Google Apps Script, but that requires coding. For most users, INDEX/MATCH is simpler.
Related
- Explain Enum in Java: Syntax, Uses, and Examples
- K Value in Battery Testing: What It Means
- Solar Installation with Battery Calculator: How to Size
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Workbook Sharing: Collaborate Without ConflictsTo share an Excel workbook for live collaboration, save it to OneDrive or SharePoint Online, select the Share…
- Google Sheets: How to Generate Unique IDsYes. Google Sheets can generate unique IDs with a row-based formula for simple lists, or with Google Apps…
- Google Sheets Date Formatting: A Practical Guide to DatesTo format a date in Google Sheets, select the cell or range, then choose Format > Number >…
- Microsoft Excel Workbook: What It Is and How to Use OneA Microsoft Excel workbook is a file that stores spreadsheet data and the parts used to organize, calculate,…
- Conditional Formatting in Microsoft Forms: What Works?Microsoft Forms does not have a built-in conditional-formatting feature for changing question or answer colors based on a…
- Excel Unmerge Shortcut: How to Unmerge Cells on WindowsIn Excel for Microsoft 365 on Windows, select a merged cell and press Alt, H, M, U to…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.