Skip to main content

Excel formula builder

XLOOKUP Formula Builder

Generate an XLOOKUP formula for exact match, approximate match, wildcard match, or a two-condition lookup pattern. Use it when you want not-found handling and flexible return columns.

Builder inputs

Use single-criterion mode for a normal lookup, or multiple-criteria mode to match two columns at once.

Formula is valid and ready to copy.

Excel formula
=XLOOKUP(A2, Products!A2:A100, Products!D2:D100, "Not found", 0)
Google Sheets formula
=XLOOKUP(A2, Products!A2:A100, Products!D2:D100, "Not found", 0)
Support note
Google Sheets supports XLOOKUP, but older Excel versions may require INDEX MATCH or VLOOKUP instead.

How this formula works

  • XLOOKUP searches the lookup array for the lookup value and returns the aligned value from the return array.
  • Multiple-criteria mode searches for 1 across multiplied TRUE/FALSE criteria arrays.
  • The optional not-found argument prevents raw #N/A errors in dashboards and reports.
  • Match mode controls exact, approximate, and wildcard behavior.

Best fit

Best for

  • Modern Excel and Google Sheets lookup formulas with clear not-found handling.
  • Left lookups where the return column is before the lookup column.
  • Exact-match dashboards that should show a friendly message when no match exists.

Not for

  • Older Excel versions that do not support XLOOKUP. Use INDEX MATCH or VLOOKUP instead.
  • Returning every matching row. Use FILTER or QUERY for row output.
  • Approximate tier lookups unless your breakpoint table is sorted correctly.

Useful formula variations

Exact match with not found message
=XLOOKUP(A2, Products!A2:A100, Products!D2:D100, "Not found", 0)

Use this for SKUs, IDs, names, and most reference tables.

Left lookup
=XLOOKUP(F2, Products!B2:B100, Products!A2:A100, "Not found", 0)

Looks up an item name in column B and returns the SKU from column A.

Multiple criteria
=XLOOKUP(1, (A2:A100=H2)*(B2:B100=H3), D2:D100, "Not found")

Matches two conditions at once by searching for 1 across multiplied TRUE/FALSE arrays.

Wildcard match
=XLOOKUP("*"&A2&"*", Products!B2:B100, Products!D2:D100, "Not found", 2)

Use wildcard match only when partial text matching is intended.

Sample data

SKUItemCategoryPrice
A-100KeyboardHardware49
A-101MouseHardware25
B-200Desk MatOffice18
B-201NotebookOffice7

Returned results from the sample data

Lookup setupFormula patternReturned result
A2 is A-100, lookup SKU, return PriceExact XLOOKUP49
F2 is Keyboard, lookup Item, return SKULeft lookup XLOOKUPA-100
A2 is missingXLOOKUP with if_not_foundNot found

Match mode guide

Match modeMeaningUse it for
0Exact matchIDs, SKUs, names, emails, and most business lookups.
-1Exact or next smallerSorted breakpoint tables such as rates or tiers.
1Exact or next largerSorted threshold tables where the next larger match is required.
2Wildcard matchPartial text searches with * or ? characters.

Troubleshooting

ProblemLikely causeFix
#N/A resultThe lookup value is missing, has hidden spaces, or uses a different data type from the lookup array.Check the source key, trim spaces, and use the if_not_found argument for friendly output.
Multiple criteria returns not foundOne criteria range does not align with the return array or one condition never matches.Make all ranges the same height and test each condition separately before combining them.
Wildcard match returns the wrong rowThe wildcard pattern is too broad or match mode 2 was used for data that needs exact matching.Use exact match mode 0 unless partial text matching is the intended behavior.

Common mistakes

  • The lookup array and return array must have compatible dimensions.
  • Wildcard match mode only matters when the lookup value contains wildcard characters.
  • Use exact match for SKUs, IDs, names, and most business lookup keys.
  • Multiple-criteria ranges must align with the return array row by row.

Related formulas

FAQ

Does XLOOKUP work in Google Sheets?

Yes. Google Sheets supports XLOOKUP, and the generated syntax on this page works for normal exact-match and multiple-criteria patterns.

Can XLOOKUP look left?

Yes. Put the left-side column in the return array and the lookup column in the lookup array.

Why does XLOOKUP return #N/A?

The lookup value was not found or the source values do not match exactly. Check hidden spaces, mixed text-number IDs, and range alignment.

When should I use XLOOKUP instead of VLOOKUP?

Use XLOOKUP when your workbook supports it and you want not-found handling, left lookup support, or separate lookup and return arrays.

Are these formulas generated with AI?

No. The builder uses built-in spreadsheet rules in your browser and does not call an AI service.

Do I need to upload my spreadsheet?

No. Enter ranges and criteria manually. The site does not upload, store, or process spreadsheet files.