adding a leading 0 to only the numbers with 4 digits

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
 
B

bugman

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
 
S

sswilcox

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top