+ Reply to Thread
Results 1 to 18 of 18

Multi Line Cell Spliting

Hybrid View

  1. #1
    Registered User
    Join Date
    07-29-2011
    Location
    Lancaster
    MS-Off Ver
    Excel 2010
    Posts
    10

    Multi Line Cell Spliting

    Hi,

    I have a file with approx 900 rows and 8 columns, in one and only one of the columns each row contains muliple lines (between 3-5) i am wondering how to go about seperating each of the multiple lines and inserting each of them in a new column to the right (potentially creating 5 new columns). There are no delimiters seperating the lines and after trawling the internet, using Alt+010 or Ctrl+J within the 'text to column' part of excel does not seem work at all.

    If anyone has any ideas they could share i would be really grateful!

    Thank
    Sam
    Last edited by SamLPC; 07-29-2011 at 05:38 PM.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Multi Line Cell Spliting

    sample workbook please
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    07-29-2011
    Location
    Lancaster
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Multi Line Cell Spliting

    Please find attached file, i cannot post the actual file as it contains personal data but it is in the same layout.

    Thanks
    Sam
    Attached Files Attached Files

  4. #4
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Multi Line Cell Spliting

    I believe your delimiter is char(10).

  5. #5
    Registered User
    Join Date
    07-29-2011
    Location
    Lancaster
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Multi Line Cell Spliting

    Quote Originally Posted by bentleybob View Post
    I believe your delimiter is char(10).
    I have tried giving a blank cell '=CHAR(10)' and copying it into the 'other' delimited field to no avail. I believe that CHAR(10) is the same as Alt+010 and Ctrl+J which as stated originally i have tried also.

    Thanks
    Sam

  6. #6
    Registered User
    Join Date
    07-29-2011
    Location
    Lancaster
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Multi Line Cell Spliting

    Have noticed that in my sample attachment the text to column seems to work, but it does not work in my actual file?! Not sure why there does not appear to be any difference!

    Thanks
    Sam

  7. #7
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Multi Line Cell Spliting

    Try the attached. Formulas get a little clunky, but it does work.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-29-2011
    Location
    Lancaster
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Multi Line Cell Spliting

    Quote Originally Posted by bentleybob View Post
    Try the attached. Formulas get a little clunky, but it does work.
    When copied over, using same cell positions etc, what seems to work correctly in sample, does not work in real file, the first 3 formulas work but the last 2 do not they get the #value! error. It always seems to be the county... which i don't know why that makes a difference as the counties are different.

    I understand it is hard with out being able to see the actual file and 'play' with it so i appreciate your patience.

    Many Thanks
    Sam

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Multi Line Cell Spliting

    maybe your original isnt char(10)
    test one of them by deleting only the first line of text leaving the space after it intact
    them use =code(c2)
    (fwiw i get value error as well in col m,n)
    Attached Files Attached Files
    Last edited by martindwilson; 07-29-2011 at 02:53 PM.

  10. #10
    Registered User
    Join Date
    07-29-2011
    Location
    Lancaster
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Multi Line Cell Spliting

    Quote Originally Posted by martindwilson View Post
    maybe your original isnt char(10)
    test one of them by deleting only the first line of text leaving the space after it intact
    them use =code(c2)
    (fwiw i get value error as well in col m,n)
    Seems to be CHAR(10) and thanks for confirming the error on column m, n. Its not me not going mad!

    Thanks
    Sam

  11. #11
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Multi Line Cell Spliting

    I got the same errors when there was missing data (like the country). Try ding a search and replce -- in each of the formulas in row 2 and then copying down -- substituting $c2&char(10) for $c2

    If needed, do the search and replace multiple times (it just adds the CR at the end of the reference to your text, so adding more CRs doesn't affect anything).

    Please see the attached for clarification.
    Attached Files Attached Files

  12. #12
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Multi Line Cell Spliting

    As Martin suggests, if you're not missing data, then the delimiter for the country might somehow be different from the others.

  13. #13
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Multi Line Cell Spliting

    added a new workbook to my example that should work

  14. #14
    Registered User
    Join Date
    07-29-2011
    Location
    Lancaster
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Multi Line Cell Spliting

    Hi,

    Thanks for all the assistance with this btw!

    The short formulas work perfectly, but im still having the issue with the counties, im sure you are right and it must have a different delimiter some how, even though it looks excactly the same?!

    I'll have to go over it all with a fine tooth comb see if i can come up with anything!

    Thanks again
    Sam

    p.s ill let you know if i find the issue!!

  15. #15
    Registered User
    Join Date
    07-29-2011
    Location
    Lancaster
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Multi Line Cell Spliting

    As another thought

    The county is always the last line in the cell.
    The county always recieves an error when the cell contains 3 or 4 lines.
    The county always shows and the formulas always work perfectly when the cell contains 5 lines.

    So... is this because the formulas given only work when the cell contains 5 lines and some how 'break' when the cell contains less than 5 lines???

    Please excuse my ignorance as i cannot make head nor tails of the formulas you guys have used they are currently beyond me, thank god for copy&paste!!

    Thanks
    Sam

  16. #16
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Multi Line Cell Spliting

    That's why I suggested adding &code(10) at least once to each reference to the original cell (using search and replace). That will get rid of the error messages; you will see blanks instead.

  17. #17
    Registered User
    Join Date
    07-29-2011
    Location
    Lancaster
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Multi Line Cell Spliting

    Quote Originally Posted by bentleybob View Post
    That's why I suggested adding &code(10) at least once to each reference to the original cell (using search and replace). That will get rid of the error messages; you will see blanks instead.
    I'm sorry i am baffled as to which cells i am suppose to use search and replace on? and what im supposed to be searching for and replacing

    I'm going to put it down to a long day!

    If it helps i have duplicated the error on the sample attached, as you can see if it have 3 lines the 3rd column produces an error instead of showing the 3rd line, same for the 4th line...etc

    If you could point me in the right direction, i would appriciate it

    Thanks
    Sam
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    07-29-2011
    Location
    Lancaster
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Multi Line Cell Spliting

    NEVERMIND BENTLEYBOB!

    I have understood what you meant and now it works perfectly!

    THANK YOU VERY MUCH!!!!!

    Sam

+ 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