Keep leading zeros when comparing CSV and Excel IDs

A postal code or customer ID can contain digits without being a number you should calculate with.

Leading zeros can be part of an identifier. If one export contains 00123 and the other contains 123, do not assume they refer to the same record. First check the source system’s identifier rules and whether a spreadsheet changed the value during import.

Find where the zero disappeared

Look at the original CSV in a text-aware viewer before opening and saving it through a spreadsheet. If the CSV still contains 00123 but the worksheet shows 123, investigate the import settings. If the original export already contains 123, changing the comparison tool cannot recover the missing characters.

Microsoft explains that Excel can remove leading zeros and alter long numeric-looking identifiers, and recommends treating such identifiers as text. Read its guidance on preserving leading zeros and large numbers for the relevant import and formatting options.

Display formatting is not always stored identity

A cell can display five digits using a number format while storing a numeric value. Check what the export actually writes, rather than trusting the appearance alone. Spreadsheet Comparison’s workbook reader uses available formatted display strings, so spot-check the imported ID on each side.

In a synthetic account list, account 00081 has status active. The destination export uses account 81. If Account ID is the key, a mismatch can appear as a record found only in each file. That is a useful warning to investigate the identity conversion before reviewing the status.

Do not pad every value without a rule

Padding 81 to 00081 is justified only when the source contract says the identifier has a fixed width of five characters. Other systems may distinguish 81 from 00081 or allow variable-length identifiers. A cosmetic repair can merge unrelated records.

If normalization is required, keep a separate working export and document the exact rule. Retain the original identifier in another field for review. Check for collisions after the transformation: two distinct source IDs must not silently become one key.

Recheck both identity and values

  1. Confirm the intended identifier width and data type.
  2. Inspect the original exports before editing them.
  3. Correct the export or import process when it changed the identifier.
  4. Compare again with the corrected working files.
  5. Review duplicate and missing-key warnings before trusting matches.

Read the CSV-to-XLSX guide for other representation differences, or the duplicate-key guide if normalization makes previously distinct IDs collide.