Skip to main content

Lookup formula page

XLOOKUP Exact Match Formula

Use XLOOKUP exact match for modern lookups where lookup and return ranges can be separate.

Best for

Find a modern exact match XLOOKUP formula.

What it returns

If F2 is A-101, the formula returns 25.

Copy formulas

Excel formula
=XLOOKUP(F2, A2:A100, D2:D100, "Not found", 0)
Google Sheets formula
=XLOOKUP(F2, A2:A100, D2:D100, "Not found", 0)
Excel / Google Sheets difference

Excel and Google Sheets use the same XLOOKUP exact-match pattern. The separate lookup and return arrays can be different columns, while 0 requests an exact match.

Example data

SKUItemCategoryPriceStock
A-100KeyboardHardware4918
A-101MouseHardware2532
B-200Desk MatOffice189
B-201NotebookOffice764
What it returns

If F2 is A-101, the formula returns 25.

How the formula works

  • F2 is the lookup value.
  • A2:A100 is searched for an exact match.
  • D2:D100 supplies the returned value, and Not found hides raw #N/A errors.
Syntax pieceRole in the formula
F2The SKU or key to find.
A2:A100The lookup array searched for F2.
D2:D100The return array aligned to the lookup array.
"Not found"The fallback shown when no exact key is found.
0The match mode that requires an exact match.

Verified examples

SKU to price
=XLOOKUP(F2, A2:A100, D2:D100, "Not found", 0)

Excel: Enter A-101 in F2 and use the sample product table. Returns: 25

SKU to item
=XLOOKUP(F2,A2:A100,B2:B100,"Not found",0)

Google Sheets: Enter B-200 in F2 and return the Item column. Returns: Desk Mat

Missing SKU fallback
=XLOOKUP(F2, A2:A100, D2:D100, "Not found", 0)

Excel: Enter C-999 in F2; it is absent from the sample table. Returns: Not found

Common errors and fixes

IssueLikely causeFix
A visible key returns Not foundThe key and lookup values use different number or text types, or one contains hidden spaces.Normalize both sides with TRIM or VALUE as appropriate and compare the cleaned values.
XLOOKUP returns a range errorThe lookup and return arrays do not have the same number of rows.Use matching boundaries such as A2:A100 and D2:D100.
A duplicate key returns an unexpected valueXLOOKUP returns the first matching row by default.Remove duplicate keys or use FILTER when every matching result is required.

When not to use this formula

  • Do not use XLOOKUP when every duplicate match must be returned as a list; use FILTER instead.

Alternatives

AlternativeWhen to use it
VLOOKUP Exact Match FormulaUse when the lookup key is the first column and broad legacy compatibility matters.
INDEX MATCH FormulaUse when XLOOKUP is unavailable but separate lookup and return ranges are needed.

Related formulas

Official references

FAQ

What does 0 do in this XLOOKUP?

The 0 match mode requests an exact match, so a nearby key is not accepted.

Why does the fallback appear instead of #N/A?

The fourth argument is the no-match result, so XLOOKUP returns Not found when F2 is absent.