VLOOKUP fails on values that look identical

A lookup or a join returns nothing for rows that plainly should match.

Why it happens

  • Trailing and leading spaces are invisible and are preserved exactly by anything comparing strings.
  • The non-breaking space is the version of this that survives cleanup.
  • Data entered by hand accumulates this steadily, because a trailing space costs nothing to type and nothing on screen shows it.
  • The failure mode is the annoying kind: not an error, just an empty result, which reads as “this row has no match” rather than as “these two strings differ by a character you cannot see”.

What to do now

  1. Trim both sides of the comparison rather than trying to find the bad rows.
  2. Check the length of the two values when a trim does not fix it.
  3. Handle the non-breaking space explicitly, by its character code.

Next time

Every cell is trimmed before it is typed or compared, so “ ACME ” and “ACME” are one value rather than two: they collide on a unique field, and they merge across deliveries instead of producing a second row for the same supplier.

Start from the vendor price list template.

Related problems

Set your fields once

Every file after that is checked before anything lands.