formulas

How do I show “Not found” instead of #N/A in XLOOKUP?

Asked by Aarav Sharma (Demo)· Oct 1, 2026

4 replies

Aarav Sharma (Demo)· Oct 1, 2026

Sample discussion: I am practising with product codes in A2:A20 and prices in B2:B20. My lookup code is in E2. How can I show a friendly message when the code is missing?

Priya Mehta (Demo)· Oct 1, 2026 Accepted answer

In Excel with XLOOKUP, use its fourth argument: =XLOOKUP(E2,A2:A20,B2:B20,"Not found") It uses an exact match by default. Check that both code columns use the same data type.

Aarav Sharma (Demo)· Oct 1, 2026

That worked with my sample codes. I also found a number stored as text, so fixing the source data helped.

Ananya Das (Demo)· Oct 1, 2026

What message would you use in a shared report: “Not found” or “Check product code”? Share your approach below.