Search for Free Tech Tips
Browse
Print Email

How to Add Leading Zeros to Excel Columns

=CONCATENATE(IF(G1>9999,"",IF(G1>999,"0",IF(G1>99,"00",IF(G1>9,"000","0000")))),TEXT(G1,0))
If the column with the old zips is "R" and your list starts on row 8 paste it into R8 change the "A1"s to "R8"s in the formula then copy/paste that cell all over your column. You should end up with a text output of this formula that has the leading zeroes attached.

Finally to clean up insert another new column. copy the new concatenated column and go edit>paste special>values, then you should have just text with leading zeroes, and you can delete the first two columns (the old zips and the formulas)

Note: This formula works for other items besides zip codes. 

 
 
1

Article Information

Say you've got a column of zip codes, your friend entered them as numbers but didn't notice that "03875" comes out as "3875". Insert a new column beside your old zip codes, then copy and paste this function:

Creation Date March 22,2008
Article Tags Microsoft Concactenation
Advertisement

Can't find what you're looking for?


Submit a question or problem.

Infotree Web Services Website Designed &
Developed By
© 2008 freetechtips.com. All rights reserved.