| Key facts | |
|---|---|
| Formula | =VALUE(A2) |
| Menu | Error indicator > Convert to Number |
| Add zeros back | =TEXT(A2,"000000000000") |
| Never strip | UPCs, EANs and GTIN-14s |
When should zeros go, and when must they stay?
| Field | Remove leading zeros? | Why |
|---|---|---|
| Supplier part number padded to a fixed width | Only to match your item numbers | Compare like with like |
| Quantities and prices stored as text | Yes | So they calculate |
| UPC (GTIN-12) | No | Every digit is part of the code |
| EAN-13 or GTIN-14 | No | Fixed-length GS1 numbers |
Microsoft's article on converting numbers stored as text covers VALUE and the Convert to Number option (Microsoft). GS1 US defines each GTIN by a fixed number of digits, 12 for a UPC (GS1 US).
How do you match part numbers when one side has zeros?
Bring both sides to the same form before a lookup. Either strip both with =VALUE(), if every part number is purely numeric, or pad both to the same width with TEXT, such as =TEXT(A2,"000000") for six digits. Mixed letters and numbers need text handling, not VALUE.
How do you put leading zeros back?
=TEXT(A2,"000000000000") rebuilds a 12-digit code as text, and a custom number format can display zeros while the cell stays a number (Microsoft). A code already shown as 7.61E+11 has lost digits and cannot be rebuilt this way; ask the supplier for the file again.
More questions on excel and percent changes: What is the percentage increase from $200 to $300? · How do you do a 3% increase in Excel? · How do you calculate a price decrease percentage? · How do I stop Excel removing leading zeros in a CSV?
Common questions
How do I remove leading zeros from a whole column?
Put =VALUE(A2) in a helper column, fill it down, then paste the results as values over the original.
Why are my leading zeros not appearing in Excel?
Excel converts numeric-looking text to numbers by default, which drops the zeros; format the column as Text before entering or importing the data.
Can I remove leading zeros without changing the cell to a number?
Yes, with text functions, but for numeric part numbers VALUE is simpler; keep the result as text if your ERP expects text.
First supplier file free. Pilot $500 for up to 5 files. Then $950 a month for up to 15 files, $60 per extra file. Every file back within 24 hours, or it is free.
Send your first file