+ Reply to Thread
Results 1 to 4 of 4

Splitting String of Zips

  1. #1
    Registered User
    Join Date
    10-01-2013
    Location
    new york
    MS-Off Ver
    Excel 2007
    Posts
    2

    Splitting String of Zips

    Hello --

    I need help with the following...

    I have four rows in excel, each with a list of comma separated zip codes:

    A1: ’73101,73102,73103,73104,73105,73106,73107,73108
    A2: ’75201,75202,75203,75204
    A3: ’71823,71825,71826,71827
    A4: ’15122,15201,15202,15203
    etc.

    I need to take the above and turn it into the following:

    B1: “73101″, “73102″, “73103″, “73104″, “73105″, “73106″, “73107″, “73108″, “75201″, “75202″, “75203″, “75204″, “71823″, “71825″, “71826″, “71827″, “15122″, “15201″, “15202″, “15203″

    So in plain english, I need to take a few rows of comma separated zip codes, put them in double quotes, then concatenate the zips together with a comma all in one row. A few issues:
    - The first zip in each row starts with a single quote.. I need to get rid of that
    - The last zip in each row does not have a comma.. I need to add a comma
    - I need to then concatenate all the zips into one row using a formula, so that in the future, I can drop a bunch of zips in the format shown in A1 – A4 and have it spit out as shown in B1.

    Can this all be done using formulas?

    Any help here would be huge! Thanks!
    Erin

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Splitting String of Zips

    maybe like this one.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Note: change my reference to A1 then fill handle drag down. Then concatenate the out come of those formulas.thanks
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Registered User
    Join Date
    10-01-2013
    Location
    new york
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Splitting String of Zips

    Hi vlady --

    That almost worked. Here are the snags:

    Issue 1:
    For rows with one zip code:
    i.e. A1 = '75001,

    The output with this formula is:

    75001" , ""

    Issue 2:
    The first zip in the string still begins with the single quote.

    I.e. A2 = '73001,73002,73003

    The output with this formula is:

    '73001", "73002", "73003"

    Issue #3
    I also need to add a comma at the end of each string... So a comma is needed above after "73003"

    Let me know what you think. Really appreciate your help with this.

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Splitting String of Zips

    split.xlsx

    I did not notice there is another character involve. look attachment for edited formula.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 02-12-2013, 10:16 AM
  2. splitting a string
    By spinkung in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-29-2012, 08:57 AM
  3. [SOLVED] Unzip - multiple zips
    By JohnUK in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-28-2006, 05:45 PM
  4. [SOLVED] Splitting a text string into string and number
    By mcambrose in forum Excel General
    Replies: 4
    Last Post: 02-21-2006, 11:50 AM
  5. Splitting a String
    By AMK4 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-13-2006, 08:15 PM

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