adding a leading 0 to only the numbers with 4 digits

  • Thread starter Thread starter SwampYankee
  • Start date Start date
S

SwampYankee

I'm converting a bunch of data and during the import Excel dropped the
leading zero from all the lip codes. Since this is about 15,000
records, I'd like a way to add a leading zero to only the zip codes
with 4 characters. Any ideas?
thanks
 
I'm converting a bunch of data and during the import Excel dropped the
leading zero from all the lip codes. Since this is about 15,000
records, I'd like a way to add a leading zero to only the zip codes
with 4 characters. Any ideas?
thanks
Dohhhh!!..........Thanks, should have known that, thanks
 
I know this is way after the fact, but for the archive...

Alternatively (if it were not zip codes but some other similar
situation), you can use the "text" function. Assuming your data begins
in A1, in cell B1 type: =TEXT(A1,"00000"). Copy down to the end of your
data. Then highlight the data in column B and copy/paste special/values
back into column A. This will work for any number of characters, just
change the number of zeros in the formula.

S
 
Back
Top