Price File Desk

How do I remove leading zeros in Excel?

Convert the text to a number: =VALUE(A2) turns 00123 into 123, and Excel's error-indicator option Convert to Number does the same for a selected range. Do not strip zeros from UPCs or GTINs, though: the zero is part of the code, and an 11-digit UPC will not match the 12-digit original.

Updated November 25, 2026 ยท 3 sources listed at the end

Key facts
Formula=VALUE(A2)
MenuError indicator > Convert to Number
Add zeros back=TEXT(A2,"000000000000")
Never stripUPCs, EANs and GTIN-14s

When should zeros go, and when must they stay?

Leading zeros in a price file
FieldRemove leading zeros?Why
Supplier part number padded to a fixed widthOnly to match your item numbersCompare like with like
Quantities and prices stored as textYesSo they calculate
UPC (GTIN-12)NoEvery digit is part of the code
EAN-13 or GTIN-14NoFixed-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