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:
| How it got into Excel | Entered | Stored | Zero lost? |
|---|---|---|---|
| Typed into a cell formatted as General | 012345678 | 12345678 | Yes |
| Opened from a CSV file by double-clicking it | 012345678 | 12345678 | Yes |
| Typed after an apostrophe | '012345678 | 012345678 (text) | No |
| Typed into a cell formatted as Text first | 012345678 | 012345678 (text) | No |
| Imported with Data > From Text/CSV, column set to Text | 012345678 | 012345678 (text) | No |
| Custom number format applied after the zero was removed | 12345678 | 12345678 | Yes; 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
- 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.
- 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.
- 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.
- Use an apostrophe for a one-off entry. Typing '012345678 stores the value as text.
- 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:
- Don't pad it. You can't tell from 12345678 whether one zero, two or none were lost.
- Don't treat it as a new driver. Booking an addition and a removal for one person hides the real question.
- Check the other details. Same name, date of birth and license state make a lost zero more likely; any disagreement makes it less likely.
- Confirm against the license or the client, and note which source settled it.
- Fix the file that lost it. If the renewal list came through Excel, correct the column there too, or the same question returns next year.
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:
- When an XLSX file stores those values as numbers, Clarito warns that leading zeros may have been lost, naming the column and the cells.
- Any proposed change for that driver or item is then flagged for review, so it can't be approved in a batch without being looked at. If nothing changes, the warning stays a note.
- Values are used as stored. Clarito never pads or guesses missing zeros.
- Spaces, hyphens and the apostrophe that forces text in a spreadsheet are read as formatting, so "D 000-0202" and "'D0000202" compare as the same license.
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.
Related guides
- Jr, Sr and last-first: matching driver names on schedules
- VIN check digits: catch vehicle schedule typos before renewal
- USPS address abbreviations for matching location schedules
- Year/Make/Model in one cell: splitting vehicle descriptions in Excel
Sources
- Keeping leading zeros and large numbers (Microsoft Support): why Excel removes leading zeros, the 15-digit limit, Text format, the apostrophe, importing with the column set to Text, and the custom format caveat.
- Set automatic data conversions (Microsoft Support): the option to keep leading zeros, where it is, which versions have it, and that opening a CSV triggers conversion.
- U.S. drivers license number entity definition (Microsoft Learn): license number formats depend on the state.
This article explains a data check. It is not coverage, underwriting or legal advice.