+ Reply to Thread
Results 1 to 5 of 5

Multiline Cell ---> SingleLine Cell with space

  1. #1
    Registered User
    Join Date
    09-16-2009
    Location
    Los Angeles
    MS-Off Ver
    Excel 2003
    Posts
    5

    Question Multiline Cell ---> SingleLine Cell with space

    I have a cell with entries as follows for example

    abcd
    efgh
    ijkl

    i would like to split it over multiple columns.

    Let me be a little more specific

    my data is arranged as follows in the cell

    abcd<space><enter>
    efgh<space><enter>
    ijlk<space>
    I want it as follows in ONE cell as follows

    abcd<space>efgh<space>ijkl
    OR

    Column 1 Column 2 Column 3
    abcd efgh ijkl
    Things I have already tried.

    1. "Data -->Text to columns" : doesn't work for some reason, only my first string "abcd" is being read. Please do remember I have more than a thousand entries so manual change on each cell would be difficult.

    2. =clean() : removes the spaces making data splitting impossible.

    3. =trim() : same as above

    I need help on this asap guys
    Thanks a ton in advance
    Attached Files Attached Files
    Last edited by watsindename; 09-18-2009 at 06:46 PM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,445

    Re: Multiline Cell ---> SingleLine Cell with space

    Hi,
    try this:

    =SUBSTITUTE(A2,CHAR(10)," ")
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Multiline Cell ---> SingleLine Cell with space

    ...and then these three formulas can do the "alternate output" for you in three separate cells:

    D2:
    =LEFT(CLEAN(A2),FIND(" ",CLEAN(A2))-1)

    E2:
    =MID(CLEAN(A2),FIND(" ",CLEAN(A2))+1,LEN(CLEAN(A2))-LEN(D2)-LEN(F2)-2)

    F2:
    =MID(CLEAN(A2),FIND("|",SUBSTITUTE(CLEAN(A2)," ","|",2))+1,99)

    Note: The formula in the middle won't work until the both the outer formulas are in place.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Multiline Cell ---> SingleLine Cell with space

    You can use the VBA Split Function to separate the contents to separate olumns
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Multiline Cell ---> SingleLine Cell with space

    Thanks for the rep points, but can you say whether this is Solved & if so mark it Solved

+ 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