Skip to content
Clarito

Excel leading zeros: keep driver license numbers intact

By the Clarito Editorial Team · Published

Excel treats a license number made only of digits as a number, and numbers don't have leading zeros. Type or open 012345678 in an ordinary cell and Excel keeps 12345678. On a driver schedule that one missing character makes a driver you already insure look like someone new, or makes a license look changed when it isn't. The fix is to keep ID columns as text from the start, and to treat any license that differs only by leading zeros as a question for the source, not a correction to make by guesswork.

Key takeaways

  • Excel removes leading zeros from values it reads as numbers, both when you type them and when you open a CSV file.
  • Once the zeros are gone, applying a custom number format won't bring them back.
  • Format ID columns as Text before entering data, or import CSV files with the column set to Text.
  • In current versions of Excel you can switch off the automatic conversion that removes leading zeros.
  • When two lists disagree on a license by leading zeros only, confirm it against the license or the client. Don't pad it to a length you guessed.

Why Excel drops the zeros

Microsoft explains that Excel removes leading zeros and shows large numbers in scientific notation so that formulas and math can work on them (Keeping leading zeros and large numbers). A license number is never used in math, but Excel has no way to know that from the digits alone. The same page notes a second limit: Excel keeps at most 15 significant digits, so in any longer string of digits stored as a number, everything past the fifteenth digit becomes zero.

Driver license formats depend on the issuing state, and some states issue numbers made only of digits (Microsoft's reference on U.S. license number patterns uses New York's nine digits as its example). Any all-digit ID can begin with a zero, and when it does, a spreadsheet can drop it. The same goes for equipment serial numbers and ZIP codes.

Where license numbers lose their zeros

The value is safe only if it reached the cell as text. These are the usual paths, shown with a fictional license number:

Ways a license number reaches an Excel cell and whether the leading zero survives
How it got into ExcelEnteredStoredZero lost?
Typed into a cell formatted as General01234567812345678Yes
Opened from a CSV file by double-clicking it01234567812345678Yes
Typed after an apostrophe'012345678012345678 (text)No
Typed into a cell formatted as Text first012345678012345678 (text)No
Imported with Data > From Text/CSV, column set to Text012345678012345678 (text)No
Custom number format applied after the zero was removed1234567812345678Yes; the format doesn't bring it back

The second row is the one that catches people. A CSV file holds plain text, so the zeros are still in the file when it arrives. Microsoft lists opening a .csv file as one of the moments Excel converts data automatically (Set automatic data conversions). If the file is then saved, the workbook or CSV now holds 12345678, and the next person to receive it has no sign anything changed.

The last row is the trap on the way back. Microsoft notes that a custom number format will not restore leading zeros removed before the format was applied. Formatting the column after the fact doesn't recover the license as it was written, and nothing in the cell tells you how many zeros it had.

How to keep the zeros

  1. Format the column as Text before you type or paste. Select the column, press Ctrl+1, and choose Text on the Number tab. Microsoft notes this does not change values already entered, so do it first.
  2. Import CSV files instead of opening them. Use Data > From Text/CSV, select the license column, and set its data type to Text before loading, as Microsoft's article describes.
  3. Switch off the automatic conversion where you can. In Excel for Microsoft 365 and Excel 2024, File > Options > Data > Automatic Data Conversion (Excel > Preferences > Edit on a Mac) has an option to remove leading zeros and convert to a number. Clear it and Excel keeps 00123 as text. Microsoft notes these options don't apply to data imported with Power Query, which has its own data types.
  4. Use an apostrophe for a one-off entry. Typing '012345678 stores the value as text.
  5. Ask for the source, not a re-typed list. When a client sends a driver list, an export from their system or a copy of the license is more reliable than a spreadsheet someone keyed by hand.

When the renewal list and the schedule disagree

Suppose the existing driver schedule has license 012345678 and the renewal list has 12345678 for a driver with the same name and date of birth. The likely story is a lost zero, but it is still a story:

How Clarito handles license numbers

Clarito compares an account's existing schedules with new or renewal information and proposes each change with its source for you to approve, reject or edit. For license numbers on Drivers schedules, and serial numbers on Equipment schedules:

One limit is worth knowing: if a file was already saved as CSV after Excel removed the zeros, the shorter number arrives as ordinary text, and no tool can tell it once had more digits. That is why the habits above matter more than any check afterwards. Nothing changes in the approved schedule without your decision. See how Clarito works.

Sources

This article explains a data check. It is not coverage, underwriting or legal advice.