formulas
4 replies
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?
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.
That worked with my sample codes. I also found a number stored as text, so fixing the source data helped.
What message would you use in a shared report: “Not found” or “Check product code”? Share your approach below.