Practical guide

Keep leading zeros when converting CSV to Excel

Treat product codes and postal codes as text, before a spreadsheet changes them.

Start with the original export

Consider this teaching example: a product code is 00127, a postal code is 02108, and a reference is 12345678901234567. They identify records; they are not quantities to add together.

product_id,postal_code,reference
00127,02108,12345678901234567

A CSV holds characters and separators, not spreadsheet column types. When a spreadsheet interprets a field as a number, its displayed value can change. Microsoft documents both leading-zero removal and Excel’s fifteen-significant-digit numeric precision limit. Saving identifiers as text avoids that numeric conversion.

Convert without guessing the column types

  1. Open the CSV to Excel converter and load the original file, or use its example.
  2. Preview it. Confirm that the product code still begins with two zeros and the long reference matches digit for digit.
  3. Download the XLSX workbook. TableMender writes every field as a text cell, including fields that look like dates or formulas.
  4. Open the workbook and compare a few records with your export. Convert only the columns that are actual quantities if you need sums or numeric sorting.

Open the text-preserving converter →

Two checks that catch a misleading result

First, inspect the value itself rather than only its appearance. A custom display format can show a fixed number of digits without changing the underlying value. Second, compare a long reference from beginning to end. A familiar-looking start does not prove its later digits were retained.

TableMender keeps all fields as text in its XLSX output. It does not restore zeros or digits that were already removed in an earlier export.

If you import directly in Excel

Microsoft provides an alternative: use the text/CSV import workflow and set identifier columns to Text before loading them. Interface names differ by Excel version. Consult Microsoft’s instructions for your installation, and use the original file rather than a workbook that has already converted the identifiers.

When a text-only workbook is the wrong tradeoff

If you need quantities, dates or formulas to behave as typed spreadsheet values, this first version does not infer them. Keeping a code intact takes priority over automatic conversion. For a mixed workbook, keep a source copy and deliberately convert appropriate columns after checking them.

Sources:

Examples are original teaching data. Tool-specific behavior describes this version of TableMender; software interfaces can vary by version.

← All guides