+ Reply to Thread
Results 1 to 7 of 7

Copying and Separating out delimited fields

  1. #1
    Registered User
    Join Date
    06-09-2011
    Location
    Granada Hills, CA, USA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Copying and Separating out delimited fields

    I need to find a way to take a string exported from database where fields are separated by a special character and repeat the line while separating out the fields which have been strung together.
    e.g.CI-5210-410*15918ý15920
    and separate to two lines
    CI-5210-410*15918
    CI-5210-410*15920
    Need to repeat this with many lines and on some lines 10-20 different separations
    Any suggestion?
    Attached Files Attached Files
    Last edited by ahunter488; 06-09-2011 at 01:54 AM. Reason: Attaching sample

  2. #2
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Copying and Separating out delimited fields

    Hello, Welcome to the forum.

    Used 2 helper columns in E & F. Also used a dynamic range.

    See the 2nd tab.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  3. #3
    Registered User
    Join Date
    06-09-2011
    Location
    Granada Hills, CA, USA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Copying and Separating out delimited fields

    Quote Originally Posted by Haseeb A View Post
    Hello, Welcome to the forum.

    Used 2 helper columns in E & F. Also used a dynamic range.

    See the 2nd tab.
    This is working great in your sample, however I am having difficulty determining exactly how it works so that I can carry it over into my real life sample where I have more columns. When I attempt copy and paste and changing column names, I still get data from your sample and not my data. Thank you for your help with both of my questions!

  4. #4
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Copying and Separating out delimited fields

    Activate the sheet contains data, then you need to define these named ranges. Press Control+F3, then click New.

    Name: Length
    Refers to: MATCH(REPT("Z",255),$A:$A)
    Click OK

    Change A:A to the first col in the real data, assume A:A contains only text entries, not numbers. Numbers with alphabets fine.

    Again, click New

    Name: Width
    Refers to: =MATCH(REPT("Z",255),$1:$1)
    OK

    Change 1:1 to the first Row in the real data, assume row 1:1 contains only text entries, not numbers. Numbers with alphabets fine.

    Again click New

    Name: Data
    Refers to: =OFFSET($A$1,,,Length,Width)
    OK

    Change A1 to the first heading in the data. here assume heading starts on A1, then A2 to down the data.

    Use the 2 helper columns end of the data in this sequence. Row Position, then Total Numbers.

    Eg: If your data range is A:Z use A:A for Row Position & AB for Total Numbers.

    Copy the heading to a new sheet, say A3, A4 to across use the formula shown in the sample.

    The last column formula Field4 use where the heading of the data contains ý for all other columns use the A4 formula.

    Or attach your data heading with dummy data.

  5. #5
    Registered User
    Join Date
    06-09-2011
    Location
    Granada Hills, CA, USA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Copying and Separating out delimited fields

    So I manage to get this working with one exception and was hoping you could provide some advice. When the formula encounters a s/n with an alphanumeric character, an invalid value occurs and says the data is not the same type as formula. Please see attached.

  6. #6
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Copying and Separating out delimited fields

    Replace D4, formula with this then copy down.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-09-2011
    Location
    Granada Hills, CA, USA
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Copying and Separating out delimited fields

    I don't believe I ever said thank you...this worked like a charm!

+ 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