XLOOKUP cannot find a product code: is it missing or duplicated?

A laptop, colour-tagged cartons and a notebook sit on a desk by a window.

Key points

  1. Distinguish missing matches from duplicates rather than masking them with zero.
  2. Check exact matching and the uniqueness of product codes.
  3. Validate known examples and document versions and exception handling.

What should you do when XLOOKUP cannot find a product code?

Separate a missing match from multiple matches, then check the code, lookup range and product master. Do not replace an unresolved result with zero or choose an arbitrary price. A lookup pairs records; it does not decide which record is valid.

This guide focuses on product-code matching rather than general formula writing. Preserve the original file and test known examples in a working copy. If the result feeds a quotation or fulfilment instruction, obtain the responsible person’s confirmation before using it.

Which matching method suits product codes?

Exact matching is normally appropriate. XLOOKUP defaults to an exact match and returns the first match in its default search direction; if_not_found can display specified text. Microsoft: XLOOKUP.

In a fictional layout, A2:A20 contains product codes, B2:B20 product names and E2 the code to check. Try =XLOOKUP(E2,A2:A20,B2:B20,"Check required",0) in a copy, adjusting the references. Looking up the name before checking the price makes a wrong product easier to spot.

Hands hold two blank tags above a printed table beside a laptop.

How should you investigate a missing match?

Look for the product in the master file first. Is it new, discontinued, recorded under a variant code, or outside the lookup range? Compare the input with the master character by character, including spaces, symbols and how the code is stored. Do not indiscriminately remove leading zeroes: they may be part of the identifier.

Record the queried code, source, reason and owner of the investigation. Keep unresolved outputs visibly marked rather than mixing them into approved prices or stock totals. This is a workflow recommendation, not a claim that every missing match has the same cause.

Can you simply accept the first of two matching records?

No: the first result is not proof of correctness. As an initial check, =COUNTIF(A2:A20,E2) counts cells meeting the criterion. Microsoft: counting by criteria.

Ask the data owner whether the records represent different variants, branches or effective dates and therefore need more specific matching conditions. If a record was copied accidentally, retain the reconciliation history before correcting it. Do not conceal the conflict inside the lookup. Codes containing wildcard characters require a separate check of how criteria are interpreted. Microsoft: COUNTIF criteria.

Which examples should be checked before operational use?

Build a small fictional test set containing a unique existing code, a missing code, a duplicated code, a newly added code and one with a leading zero. Write down the expected name and whether the process should stop for review before comparing the formula outputs.

Success does not mean every cell contains a number. Valid records should match correctly, missing items should remain visible and conflicts should not become quotations. Record the test date, Excel version, master-file version and reviewer so the checks can be repeated when the range or source changes.

What should colleagues receive with the formula?

Provide a short operating note covering the input cells, master-file owner, update process, escalation contact and outputs that must not be sent directly to customers. A formula without an exception-handling process is an incomplete handover.

Check the recipient’s version first: Microsoft states that XLOOKUP is unavailable in Excel 2016 and 2019. Version limitation. If unsupported, ask the maintainer to select and validate a compatible method. Opening the workbook is not enough to establish that it works.

Frequently asked questions

Should a missing product return zero?

Prefer a visible review status. Zero could be mistaken for a valid price or quantity; unresolved codes need an owner.

Does XLOOKUP validate duplicate products?

It does not make that business judgement. The default returns the first match, so uniqueness needs a separate check. Microsoft guidance

Can rows be deleted when COUNTIF is greater than one?

No. Establish whether they represent variants or effective dates first; a count is not authorisation to delete records.

Should you switch to approximate matching to get an answer?

Not for an unresolved product code. Matching the wrong product can be more harmful than flagging it for review; establish the coding rule first.

Can colleagues use the file as soon as it opens?

Not necessarily. Check their version and test results; Excel 2016 and 2019 do not support XLOOKUP. Version guidance

About the author: This article was written by the HKONE team. HKONE is a Hong Kong digital marketing and AI automation company providing social media management, website design, AI customer service and GEO / SEO for SMEs. Where this article mentions platform fees or policies, the platform's official information takes precedence.

Tell us about your business first. Then decide.

The consultation is free. We will understand your situation before recommending a plan and a quote.