XLOOKUP in Excel lets you quickly find and return data from a table or range by searching for a match in one column and returning a corresponding value from another—replacing older VLOOKUP and HLOOKUP functions with more flexibility and fewer errors.

What You'll Need

  • Microsoft Excel 2021, Excel for Microsoft 365, or Excel for the web
  • A worksheet with two columns: one containing lookup values and another containing return values
  • Basic familiarity with Excel formulas and cell references

Step-by-Step

  1. Open your Excel workbook and navigate to the worksheet containing your data.
  2. Identify the lookup value you want to search for—for example, a product ID in cell A2.
  3. Determine the lookup array—the column or row where Excel will search for that value. For instance, if product IDs are in column D from D2 to D100, your lookup array is D2:D100.
  4. Determine the return array—the column or row from which you want to retrieve a result. If prices are in column E from E2 to E100, your return array is E2:E100.
  5. Click on the cell where you want the result to appear—for example, B2.
  6. Type the formula: =XLOOKUP(A2, D2:D100, E2:E100) and press Enter.
  7. Excel will search for the value in A2 within D2:D100 and return the corresponding value from E2:E100.
  8. To handle cases where no match is found, add a fourth argument for the if_not_found value: =XLOOKUP(A2, D2:D100, E2:E100, "Not Found").
  9. To perform an approximate match (e.g., for tax brackets), add a fifth argument: match_mode. Use -1 for exact match or next smaller item, 1 for exact match or next larger item. Example: =XLOOKUP(A2, D2:D100, E2:E100, "Not Found", -1).
  10. To search from bottom to top (reverse order), add a sixth argument: search_mode. Use -1 to search last-to-first. Example: =XLOOKUP(A2, D2:D100, E2:E100, "Not Found", 0, -1).
  11. Drag the fill handle down to apply the formula to other rows if needed.

Common Mistakes

  • Using mismatched array sizes—lookup and return arrays must be the same length and orientation (both vertical or both horizontal).
  • Forgetting to lock array references with $ when copying formulas, causing ranges to shift incorrectly.
  • Assuming XLOOKUP works like VLOOKUP with column index numbers—it does not; you must specify the return array directly.
  • Using approximate match mode without sorted data, which can return incorrect results.
  • Not accounting for text vs. number mismatches—for example, searching for "123" in a column of actual numbers.

Tips

  • Use whole-column references (like D:D) only if you’re certain there’s no irrelevant data below, as it can slow performance.
  • Combine XLOOKUP with XLOOKUP for two-way lookups: one to find the row, another to find the column.
  • Use the if_not_found argument instead of wrapping XLOOKUP in IFERROR for cleaner, more readable formulas.
  • When working with tables, use structured references (like Table1[ID]) for formulas that auto-adjust as data grows.
  • Test your formula with known values first to verify it returns the expected result before applying it broadly.

Troubleshooting

  • If you get a #VALUE! error, check that your lookup and return arrays are the same size and orientation—one vertical, one horizontal will cause this.
  • If you get #N/A despite a visible match, verify data types: numbers stored as text won’t match actual numbers. Use VALUE() or TEXT() to convert, or check for hidden spaces with TRIM().
  • If the formula returns an incorrect value, ensure your data is sorted if using approximate match (-1 or 1 match_mode).
  • If the formula seems to ignore changes, check if the workbook is set to manual calculation—go to Formulas > Calculation Options and select Automatic.
  • If XLOOKUP isn’t available, you’re using an older version of Excel. Consider upgrading or use INDEX and MATCH as an alternative.

Frequently Asked Questions

Can XLOOKUP search rows instead of columns?

Yes—just use horizontal ranges as your lookup and return arrays. For example, =XLOOKUP(A1, B1:Z1, B2:Z2) searches across row 1 and returns a value from row 2.

Is XLOOKUP better than VLOOKUP?

Yes in most cases—it doesn’t require the lookup column to be first, supports reverse search, and handles errors more cleanly with a dedicated if_not_found argument.

Can I use XLOOKUP with multiple criteria?

Not directly, but you can concatenate lookup values and arrays—for example, =XLOOKUP(A2&B2, C2:C100&D2:D100, E2:E100) to match on two columns.

Why does my XLOOKUP return #SPILL!?

This happens when the formula tries to return multiple values but blocked cells prevent it. Clear the obstructed area or use implicit intersection with @ if returning a single value is intended.

Does XLOOKUP work in Excel for Mac?

Yes, XLOOKUP is available in Excel for Mac as part of Microsoft 365 or Excel 2021 and later.

Can I nest XLOOKUP functions?

Yes—use one XLOOKUP to find a row, another to find a column within that row’s data for a true two-way lookup.