+ Reply to Thread
Results 1 to 5 of 5

Split cell values based on "," and "-" and format as shown below

  1. #1
    Registered User
    Join Date
    12-15-2010
    Location
    Oregon, USA
    MS-Off Ver
    Excel 2007
    Posts
    48

    Split cell values based on "," and "-" and format as shown below

    Hi Guys,
    My raw data looks like this:-

    Package
    1. PAxx
    2. ABxx
    3.DSSxd,xf-YGxd,xf-RAKxd,xf-JJxd,xf
    4.WBxx
    5.NABpc,cu
    6.FOXdi,cu
    7.GPCpc,cu
    8.GGxd-HDxd
    9.VFHpb

    And i am trying to format it as show:-

    Package Item
    1. PAxx Paxx
    2. ABxx Abxx
    3. DSSxd,xf-YGxd,xf-RAKxd,xf-JJxd,xf DSSxd
    4. DSSxd,xf-YGxd,xf-RAKxd,xf-JJxd,xf DSSxf
    5. DSSxd,xf-YGxd,xf-RAKxd,xf-JJxd,xf Ygxd
    6. DSSxd,xf-YGxd,xf-RAKxd,xf-JJxd,xf YGxf
    7. DSSxd,xf-YGxd,xf-RAKxd,xf-JJxd,xf RAKxd
    8. DSSxd,xf-YGxd,xf-RAKxd,xf-JJxd,xf RAKxf
    9. DSSxd,xf-YGxd,xf-RAKxd,xf-JJxd,xf JJxd
    10.DSSxd,xf-YGxd,xf-RAKxd,xf-JJxd,xf JJxf
    11.WBxx WBxx
    12.NABpc,cu NABpc
    13.NABpc,cu NABcu
    14.FOXdi,cu FOXdi
    15.FOXdi,cu FOXcu
    16.GPCpc,cu GPCpc
    17.GPCpc,cu GPCcu
    18.GGxd-HDxd GGxd
    19.GGxd-HDxd HDxd
    20.VFHpb VFHpb

    I am really sorry, i dont have permission to post a "Test file" . I will appreciat any help.

    Thanks,

    Roop

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Split cell values based on "," and "-" and format as shown below

    Hi Roop,

    Welcome to the forum.

    Try exploring the Text To Column Feature of Excel.. it will help you. Thanks.


    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Valued Forum Contributor MaczaQ's Avatar
    Join Date
    06-03-2011
    Location
    Poland
    MS-Off Ver
    Excel 2003 / XP
    Posts
    510

    Re: Split cell values based on "," and "-" and format as shown below

    for each line you could try to use following code
    copy it into module, and let say you have data in column A - so in B1 type "=explode_and_join(A1)"
    Please Login or Register  to view this content.
    now I see that above code didn't solve your problem in all condition - I will think about it.
    Last edited by MaczaQ; 03-21-2012 at 04:21 PM.
    Best Regards
    MaczaQ
    ---------------------------------------------------------------------------------------------------------------------------
    If you are satisfied with the solution(s) provided, please mark your thread as Solved
    If you are pleased with my answer consider to rate it. To thank someone who has helped you, click on the star icon below their name.
    - This way you will add him some reputation points ... thanks in advance.

  4. #4
    Registered User
    Join Date
    12-15-2010
    Location
    Oregon, USA
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: Split cell values based on "," and "-" and format as shown below

    Quote Originally Posted by dilipandey View Post
    Hi Roop,

    Welcome to the forum.

    Try exploring the Text To Column Feature of Excel.. it will help you. Thanks.


    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    Hi,
    Thanks. I will try that

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Split cell values based on "," and "-" and format as shown below

    Hi Roop,


    Did you managed to solve your issue?

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ 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