Lookup & Reference
12.1K monthly searches
Intermediate
5 min read

XLOOKUP Function in Excel - Modern Lookup Formula (Replaces VLOOKUP)

The modern replacement for VLOOKUP and HLOOKUP....

Quick Start

Syntax

=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

Parameters

lookup_value - Required. The value to search for (e.g., product ID, employee name, customer code).

lookup_array - Required. The array or range to search in (e.g., A:A, Product_IDs).

return_array - Required. The array or range to return values from (can be single or multiple columns).

if_not_found - Optional. Optional. Value to return when no match found (default: #N/A error).

match_mode - Optional. Optional. 0=exact match (default), -1=exact or next smaller, 1=exact or next larger, 2=wildcard.

search_mode - Optional. Optional. 1=first-to-last (default), -1=last-to-first, 2=binary ascending, -2=binary descending.

Simplest Example

ABCDE
1Employee IDNameDepartmentLookup ID:Result
2E001Alice JohnsonSalesE002
3E002Bob SmithIT
4E003Carol DavisHR
2E001Alice JohnsonSalesE002
=XLOOKUP(D1, A:A, B:B)
Bob Smith

Quick Reference

Basic XLOOKUP
=XLOOKUP(E2, A:A, B:B)

Search for E2 in column A, return corresponding value from column B

Simple vertical lookup without column counting

XLOOKUP with Error Handling
=XLOOKUP(E2, A:A, B:B, "Not Found")

Returns "Not Found" instead of #N/A error when value doesn't exist

Built-in error handling without IFERROR wrapper

Return Multiple Columns
=XLOOKUP(E2, A:A, B:D)

Return 3 columns (B, C, D) in one formula with dynamic array

Spills results across columns automatically

Two-Way Lookup (Row & Column)
=XLOOKUP(E2, A:A, XLOOKUP(F1, 1:1, 2:1048576))

Dynamic lookup by both row header and column header

Replaces complex <Link href="/formulas/index">INDEX</Link> <Link href="/formulas/match">MATCH</Link> combinations

Real-World Examples

Product Catalog Lookup - XLOOKUP vs VLOOKUP Advantage

This modern lookup function revolutionizes product catalog lookups by eliminating VLOOKUP's left-to-right limitation. Search by product code and return any column - name, price, category, supplier - regardless of position. No need to count columns or rearrange data. It handles catalog updates gracefully: add new columns without breaking formulas, reorganize fields freely, and return multiple product attributes simultaneously. This lookup solution is essential for e-commerce managers, inventory specialists, procurement teams, and sales operations who manage extensive product databases and need flexible, maintainable lookup solutions.

ABCD
1Product NameCategoryProduct IDPrice
2Laptop ProElectronicsP001$1,200
3Wireless MouseAccessoriesP002$25
4Keyboard RGBAccessoriesP003$75
5Lookup: P002
=XLOOKUP("P002", C:C, A:A)
Wireless Mouse
Pro Tip: XLOOKUP can look left! Search in column C and return from column A - impossible with VLOOKUP.
Pattern: =XLOOKUP(search_value, search_column, return_column)
Employee Database with Error Handling

Use this modern lookup function for employee records with built-in error handling - no need for IFERROR wrappers. Look up employee details by ID, name, or email and display "Employee Not Found" for invalid entries. It returns multiple columns simultaneously: name, department, salary, manager, and start date in one formula that spills across cells. This lookup solution is perfect for HR managers, payroll specialists, department heads, and people operations teams who need reliable employee data retrieval with graceful error handling for dashboards, reports, and automated workflows.

ABCD
1Employee IDNameDepartmentSalary
2E001Alice JohnsonSales$85,000
3E002Bob SmithIT$95,000
4E003Carol DavisHR$78,000
5Lookup: E999Not Found
=XLOOKUP("E999", A:A, B:D, "Not Found")
Pro Tip: Built-in error handling with 4th argument - cleaner than wrapping VLOOKUP in IFERROR.
Pattern: =XLOOKUP(id, id_column, return_columns, "default_message")

Common Mistakes to Avoid

=VLOOKUP(E2, A:C, 2, FALSE)Using VLOOKUP when XLOOKUP is available (Excel 365/2021)

❌ The Problem:

  • Can't look left - search column must be leftmost
  • Column number breaks when inserting columns
  • No built-in error handling
  • Can't return multiple columns without array formula

✅ Solution:

=XLOOKUP(E2, B:B, A:A)

This modern lookup function overcomes all VLOOKUP limitations: look in any direction, reference columns directly instead of counting, handle errors with if_not_found parameter, and return multiple columns natively. It is cleaner, more maintainable, and more powerful for modern Excel versions. Use this solution for all new projects instead of legacy VLOOKUP patterns.

=XLOOKUP(E2, A1:A100, B1:B100)Using fixed ranges instead of dynamic column references

❌ The Problem:

  • Doesn't include new rows added below row 100
  • Requires manual formula updates as data grows
  • Inconsistent across different formulas
  • Maintenance burden for large datasets

✅ Solution:

=XLOOKUP(E2, A:A, B:B)

Use entire column references (A:A, B:B) instead of fixed ranges. It handles full columns efficiently and automatically includes new data. This makes formulas dynamic and self-maintaining as your dataset expands - essential for scalable spreadsheet solutions.

=IFERROR(XLOOKUP(E2, A:A, B:B), "Not Found")Wrapping XLOOKUP in IFERROR unnecessarily

❌ The Problem:

  • Redundant - XLOOKUP has built-in error handling
  • Masks other errors (like #REF! or #VALUE!)
  • Makes formula longer and harder to read
  • Doesn't distinguish between "not found" and formula errors

✅ Solution:

=XLOOKUP(E2, A:A, B:B, "Not Found")

This solution has built-in error handling with the if_not_found parameter (4th argument). Use it instead of IFERROR wrapper for cleaner code. Only use IFERROR when you need to catch other types of errors beyond "not found" scenarios.

Frequently Asked Questions

Other Lookup & Reference Functions

Related Formulas

Master these XLOOKUP variants:

Master Excel XLOOKUP

From basics to advanced - AI generates perfect formulas instantly.