XLOOKUP in Excel is a modern, flexible lookup function that replaces older functions like VLOOKUP and HLOOKUP. It searches for a value in a range (vertical or horizontal) and returns a corresponding value from another range—without requiring the lookup column to be the first in the table. You need only Excel 365, Excel 2021, or Excel for the web (with a Microsoft 365 subscription) to use XLOOKUP—older versions like Excel 2019 or earlier do not support it.

What You'll Need

  • A copy of Excel 365, Excel 2021, or Excel for the web (with an active Microsoft 365 subscription)
  • A dataset with at least two columns or rows: one containing lookup values, and another containing the return values
  • Basic familiarity with Excel formulas (e.g., entering `=`, cell references, ranges)

Step-by-Step

  1. Open your Excel workbook and ensure your data is organized in a clean table format. For example, columns A and B might contain employee IDs (A2:A100) and their corresponding names (B2:B100). Confirm there are no blank rows or columns interrupting your data range.
  2. Select the cell where you want the lookup result to appear—say, cell D2.
  3. Enter the XLOOKUP formula. The basic syntax is: =XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]). Start typing =XLOOKUP( and Excel will hint the arguments.
  4. Define the lookup_value. This is the value you want to find—for example, D2 if you’ve typed an employee ID there, or "E1042" for a hardcoded text lookup.
  5. Specify the lookup_array. This is the range where Excel will search for the lookup value—e.g., A2:A100. Ensure this range matches the size and orientation of your data (vertical for column-based lookups, horizontal for row-based).
  6. Specify the return_array. This is the range from which to pull the result—e.g., B2:B100. It must be the same size and shape as the lookup_array (same number of rows/columns).
  7. Optionally add the if_not_found argument to prevent #N/A errors. For example, , "Not found" will display "Not found" if the ID doesn’t exist.
  8. For exact matches (the most common case), you can omit match_mode and search_mode—XLOOKUP defaults to exact match (0) and linear search from top to bottom (1). If you need approximate matches (e.g., for tax brackets), set match_mode to 1 for next smaller item, -1 for next larger, or 2 for wildcard text matches (e.g., *john*).
  9. Press Enter. The formula should return the corresponding value. Test by changing the value in D2 to verify it updates dynamically.

Common Mistakes

  • Using mismatched range sizes: lookup_array and return_array must be equal in size. If A2:A100 has 99 rows, B2:B101 also has 99 rows—B2:B100 is correct, B2:B101 is not.
  • Forgetting absolute references when copying formulas: use $ (e.g., $A$2:$A$100) to lock ranges so they don’t shift when dragging down.
  • Assuming XLOOKUP is case-sensitive: it is not. Searching for "John" finds "john" too. Use EXACT() with XLOOKUP for case-sensitive results: =XLOOKUP(TRUE, EXACT(A2:A100, D2), B2:B100, "Not found").
  • Using XLOOKUP in unsupported Excel versions: if you get #NAME? error, your version doesn’t support it. Upgrade or use VLOOKUP as a fallback.
  • Overlooking #N/A despite using if_not_found: this argument must be the fifth parameter. If you skip match_mode but include search_mode, you must include match_mode (use 0 or omit).

Tips

  • Use XLOOKUP with dynamic arrays: if your lookup_array and return_array are in Excel Tables (Ctrl+T), XLOOKUP automatically adjusts when rows are added.
  • Combine with FILTER for multi-result lookups: =FILTER(B2:B100, A2:A100=D2) returns all matching rows, not just the first.
  • Use negative search_mode for reverse searches: set search_mode to -1 to start from the bottom (e.g., find the last occurrence of an ID).
  • Handle errors with IFERROR for custom messaging: =IFERROR(XLOOKUP(...), "Error") provides an extra safety layer.
  • For horizontal lookups, swap row/column references: =XLOOKUP(D2, B1:Z1, B2:Z2) searches row 1 for D2 and returns from row 2.
  • Combine with INDEX/MATCH logic if you need multiple return values—XLOOKUP returns one value per formula, but you can nest it in an array formula or use it across multiple cells.

Troubleshooting

When XLOOKUP fails, follow these checks in order:

  1. Check Excel version: Type =INFO("releaseid") in a cell. If it returns a value below 16.0.10000 (common for older builds), update Excel via File > Account > Update Options > Update Now.
  2. Verify range alignment: Ensure lookup_array and return_array have identical dimensions. If your data starts at row 2 but you accidentally reference row 1 in one range, Excel returns #N/A or #VALUE!.
  3. Inspect for hidden characters: Use =CLEAN(A2) and =TRIM(A2) on both lookup and table data to remove nonprinting characters or extra spaces causing mismatches.
  4. Confirm data types: Text vs. number mismatches (e.g., "123" vs. 123) break matches. Convert text to numbers with =VALUE(A2) or use =TEXT(A2, "0") to force text formatting.
  5. Test with a simple case: Create a tiny 3-row table (e.g., A1:B4) and test XLOOKUP there before scaling up.
  6. Check for circular references: If your return_array includes the cell where the formula lives, Excel throws an error. Move the formula to a different cell.
  7. Review wildcards: If using match_mode=2, ensure your lookup_value contains * or ? and is enclosed in quotes if hardcoded (e.g., "*smith*").

Frequently Asked Questions

Can XLOOKUP look up values to the left of the lookup column?

Yes—unlike VLOOKUP, XLOOKUP does not require the return column to be to the right. You can reference any range for return_array, even if it’s to the left of lookup_array.

Does XLOOKUP work with multiple criteria?

Not directly, but you can simulate it by combining lookup values. For example, to match both Department and Role: =XLOOKUP(D2&E2, A2:A100&B2:B100, C2:C100) using concatenation (or =XLOOKUP(1, (A2:A100=D2)*(B2:B100=E2), C2:C100) with array logic).

Why does XLOOKUP return #N/A even when the value exists?

Most commonly due to trailing spaces, different data types (text vs. number), or case-insensitive matching not aligning with your expectations. Use =EXACT() or =CLEAN() to debug.

Can XLOOKUP search from bottom to top?

Yes—set the optional search_mode argument to -1. For example: =XLOOKUP(D2, A2:A100, B2:B100, , , -1) searches from the bottom row upward.

Is XLOOKUP faster than VLOOKUP or INDEX/MATCH?

In most practical cases, yes—XLOOKUP is optimized for modern Excel and handles unsorted data more efficiently. However, performance differences are negligible for datasets under 100,000 rows.

What if I need to return multiple columns at once?

XLOOKUP returns a single value per formula. To return multiple columns, repeat the formula for each column, or use FILTER() to spill results into adjacent cells (e.g., =FILTER(A2:D100, A2:A100=D2) returns all columns for matching rows).