+ Reply to Thread
Results 1 to 4 of 4

Split Column into Multiple Columns Based Off Specific Criteria

  1. #1
    Registered User
    Join Date
    11-30-2015
    Location
    canada
    MS-Off Ver
    2010
    Posts
    3

    Split Column into Multiple Columns Based Off Specific Criteria

    Hi guys, this one is a doozy (atleast for me) and not sure if possible but any help would be appreciated.

    I have a worksheet with a column (S) that has multiple pieces of information. For example, it has a general format below:

    Street name, Unit/floor/Suite, City, State/Province, Postal Code, Country

    Here are a few examples;

    252 CENTRAL AVE W BROCKVILLE Ontario K1V 5X1 CAN
    126 PITT ST UNIT 1 CORNWALL Ontario K9J 5H3 CAN
    2010 YONGE ST FLR 1 TORONTO Ontario M5P 2V8 CAN
    C/O PRIME CORE HOLDINGS 25 BANK ST SUITE 31 OTTAWA Ontario K5C 9A1 CAN

    As you can see it gets a bit complicated because street names can have varying word counts, and sometimes the unit/floor/suite isnt even displayed. In the last entry of the examples you can see it doesnt even begin with a street name (however, if it gets too complicated you can ignore those since they are rare).

    Here is the same examples with how I would ideally want them split.

    252 CENTRAL AVE W | BROCKVILLE | Ontario | K1V 5X1 | CAN
    126 PITT ST | UNIT 1 | CORNWALL | Ontario | K9J 5H3 | CAN
    2010 YONGE ST | FLR 1 | TORONTO | Ontario | M5P 2V8 | CAN
    C/O PRIME CORE HOLDINGS | 25 BANK ST | SUITE 31 | OTTAWA | Ontario | K5C 9A1 | CAN

    If this is considered to be overly-complicated then you could try a simpler macro (for example, ignore cases of that last example entry). I understand this is hard to do but would be a good challenge so any help would be greatly appreciated. I've looked at other similar "column split" threads but none of them seem to be as complicated in terms of criteria.

    Thanks again!

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Split Column into Multiple Columns Based Off Specific Criteria


    Hi,

    as there is no separator within text like a comma for example, it's almost not possible …

    Maybe with an attachment I may break data in 5 columns like
    Street name & Unit/floor/Suite | City | State/Province | Postal Code | Country
    if postal code is always in two words

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Split Column into Multiple Columns Based Off Specific Criteria

    Almost for the data provided.
    Please Login or Register  to view this content.
     ↓ Thanks
    Attached Files Attached Files
    Last edited by jindon; 01-31-2017 at 11:53 PM. Reason: File attached

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Split Column into Multiple Columns Based Off Specific Criteria


    Well done jindon !

    Same idea to use a regular expression but your pattern is more efficient …

+ 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. [SOLVED] Excel - Compare data based upon specific criteria split into columns and delimiters
    By Funkadlic01 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-01-2017, 09:36 PM
  2. Combine multiple rows in a specific column based on matching criteria? VBA solution?
    By hopegriffin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-06-2015, 07:11 PM
  3. Copy multiple columns and paste into one column, based on row criteria
    By Miki1989 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-17-2015, 09:59 AM
  4. [SOLVED] Formula to Sum Multiple Columns Based on Column Headings and Other Criteria
    By webfeet2 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-10-2015, 12:20 PM
  5. Split data into multiple documents based on specific column
    By v_nastey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2013, 08:56 AM
  6. [SOLVED] Need macro to split one column into multiple columns based on _ and spacing
    By snely in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-17-2012, 10:05 AM
  7. Replies: 3
    Last Post: 09-27-2011, 01:37 PM

Tags for this Thread

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