Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Nov 2001
    Location
    Massachusetts
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding 0's to zip codes (97)

    Hi,

    I have an Excel spreadsheet, in this spreadsheet, I have a zip code column. The only problem
    w/ this is that when I converted the data from Access into Excel I lost my 0's in the beginning
    of my zip codes. I have to now put this into an SQL server database, before I do this I would
    like to have the 0's again in the beginning of my zip codes.

    Does anyone know if I can do this in Excel??

    Help!!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Adding 0's to zip codes (97)

    I presume that Excel imported the zip codes as numbers.

    One way is not to store the leading zeroes, but change the formatting.
    If you format the zip code as "00000", it will display leading zeroes if necessary.

    On the other hand, if you want to store the leading zeroes, you can create a column in Excel for this:
    Say your zip codes are in A1 and down.
    In B1, put the formula =Right("00000"&A1,5) or =Text(A1,"00000")
    Either formula will convert the zip code to text displayed with leading zeroes.
    Copy down as far as needed.

  3. #3
    New Lounger
    Join Date
    Nov 2001
    Location
    Massachusetts
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Adding 0's to zip codes (97)

    Thanks

    Both methods worked great!!

  4. #4
    Silver Lounger
    Join Date
    Jan 2001
    Location
    West Long Branch, New Jersey, USA
    Posts
    1,921
    Thanks
    6
    Thanked 9 Times in 7 Posts

    Re: Adding 0's to zip codes (97)

    Another way to do this is just to format the cell entry as a zip code. I've attached a screen shot that shows:
    - a zip code entered in A1 as 707 (see formula bar)
    - the value of A1 when formatted as a zip code which is 00707
    - the format cells dialog to show where this is.

    hope this helps.

    fred
    Attached Images Attached Images

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •