+ Reply to Thread
Results 1 to 5 of 5

separating zip codes

  1. #1
    Registered User
    Join Date
    07-15-2008
    Location
    New Jersey
    Posts
    2

    separating zip codes

    i'm trying to separate a column of 9 digit zip codes into 5 and 4. i've tried the data, text to columns option but the problem is zip codes that start with 0 - even when i format them, the text to columns application reads them as only 8 digits so they don't divide in the right place. suggestions?

    thanks!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try these formulas in next columns, copied down.

    =Left(A1,5)

    and

    =Mid(A1,6,4)

    where A1 contains 1st Zip code to separate.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    07-15-2008
    Location
    New Jersey
    Posts
    2
    thanks, but there's still the problem of zip codes that start with 0. when i tried to do that, it treated 07940-2891 as 79402891, so that the first five were 79402.

  4. #4
    Registered User
    Join Date
    07-15-2008
    Location
    Ann Arbor
    Posts
    12
    You do have the cell format set to "text" correct?

    Also, the zips are without dashes?


    If so, then try this:

    =IF(LEN(A1)=8,"0"&LEFT(A1,4),LEFT(A1,5))

    =IF(LEN(A1)=8,MID(A1,5,4),MID(A1,6,4))

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Try

    =LEFT(TEXT(A1,"000000000"),5)

    and

    RIGHT(A1,4)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1