Skip to content
Excel Help

Excel Help guide · Updated 21 September 2026

Import CSV in Excel Without Losing Leading Zeros

CSV stores field text, not Excel cell formats. Double-clicking a CSV can let Excel interpret 00073 as 73 before you have a chance to choose a type.

Download the sample CSV (.csv) Download expected Excel result (.xlsx)

Example data only. No macros or sign-up. The workbooks contain test examples; their behavior has not been verified in Microsoft Excel.

The failure is visible in three rows

Raw CSV IDDate fieldExpected after text import
0007303/04/2026ID stays 00073; date stays text until its order is declared
001202026-04-05ID stays 00120
00000emptyID stays 00000; date remains empty

Open the CSV in a text editor if you need to prove what the source contained. The expected workbook has these strings in A4:A6 and deliberately leaves dates as strings in B4:B6. It is a reference result, not an automatic import connection.

Import with type control

  1. In a new desktop workbook, choose Data → From Text/CSV and select the downloaded file. Check the comma delimiter and preview.
  2. Select Transform Data. Set the ID column to Text before loading. If Power Query added an automatic Changed Type step that already converted IDs to numbers, remove or replace that step while the original file is still available.
  3. Set Date to Text too when its order is not agreed. Use a declared locale or an explicit conversion after import. Load, then compare the three IDs and dates with the reference workbook.

Changing a numeric cell's display to a five-digit format after an incorrect import makes it look padded; it does not restore the original identifier text. A CSV saved from Excel can lose formulas, formatting and extra sheets.

Compatibility

Microsoft documents Text/CSV import and Power Query type selection for current desktop Excel. Controls differ by Windows/Mac release and Excel for web; use a supported import path with an explicit text type and inspect the preview. This sample's 03/04/2026 is intentionally ambiguous.

Sources: Microsoft Support: import text or CSV and Microsoft Support: keep leading zeros.

Related tasks

More Excel tips · Broad Excel reference