How to Split Multiple Lines in a Cell into a Separate Cells / Columns

In Excel, you can use the Text to Columns functionality to split the content of a cell into multiple cells.

You can specify the delimiter (such as a space, comma, or tab) and the Text to Columns would use this delimiter to split the content of the cells.

Examples of this include splitting first and last names, or username and domain name in email ids.

However, if you have a dataset where the delimiter is a line break (in the same cell), it gets tricky to split these multiple lines in the same cell into separate cells/columns.

For example, you can have a dataset as shown below, where you need to split multiple lines in the address (separated by line breaks) into separate cells.

Split Multiple Lines in a Cell into a Separate Cells or Columns - Data

This would allow you to have the Name, Street, City, and Country in separate cells.

So the result would look something as shown below:

Split Multiple Lines in a Cell into a Separate Cells or Columns - Result needed

Now to separate each part of the address, we can use the Text to Columns functionality (with a twist).

Note: If you’re wondering how I managed to insert each address element into a new line in the same cell, you can do that by using the keyboard shortcut – ALT + Enter (it enters a line break). You can read more about it here.

Also read: Go To New Line In Same Cell in Excel

Using Text to Column to Split Multiple Lines in a Cell

Below are the steps that will split multiple lines in a single cell into separate cells:

  • Select the entire dataset that you want to split.
  • Go to the Data tab.Data Tab in the Ribbon
  • In the Data Tools group, click on the Text to Columns option.Text to Columns option in the ribbon
  • In the Text to Columns dialog box, in Step 1 of 3, select Delimited and click ‘Next’.Step 1 - Select Delimited checkbox
  • In Step 2 of 3, uncheck any existing Delimiters selection, and select the ‘Other’ option. Now Use the keyboard shortcut Control + J (hold the ‘Control’ key and then press the ‘J’ key). You will not see anything in the box except a tiny blinking dot (if you look hard). Also, you will see the expected result in the ‘Data preview’ section (as shown below). Click on Next.Step 2 in Text to Columns - Control + J Keyboard Shortcut
  • In Step 3 of 3, change the ‘Destination’ cell to the one where you want the output. In my example, I want the result in B2, so I changed the value to $B$2.Step 3 - Specify the destination
  • Click on Finish.

The above steps would automatically split the content of the cells based on where the line break occurs in each cell.

Note that if you don’t want to keep the original data (it’s always advisable to do so though), you don’t need to specify the destination cell. It will simply overwrite the existing data and give you the result.

Also, in case you already have data in the cells where you are about to get the result of Text to Columns, Excel will show you a prompt letting you know that you will be overwriting the existing data. You can choose to overwrite or cancel

Excel Text to Columns Prompt - there is already data

How does this work?

When you use the keyboard shortcut Control J, it specifies the line break as the delimiter in the Text to Columns wizard.

Now, Text to Columns checks each cell for line breaks and use it to split the content into separate cells.

Note that Text to Columns would always split the content of the cells in separate columns. If you want to get the result in cells in different rows, you can transpose the result (as shown here).

You May Also Like the Following Excel Tutorials:

Excel Ebook Subscribe

FREE EXCEL BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster

Sumit Bansal
Hello there! I'm Sumit Bansal, founder of trumpexcel.com and an Excel MVP. I started this website in 2013 with a simple goal: to share my love for Excel through easy to follow tips, tutorials and videos. I'm here to help you get the best out of MS Excel to save time and boost your productivity.

50 thoughts on “How to Split Multiple Lines in a Cell into a Separate Cells / Columns”

  1. Hey there, I don’t know somebody told you or not … but I must tell you that YOU ARE A GENIOUS” 🙂

    Reply
  2. Thanks for your article. I had read about the tweak with Ctrl+J elsewhere too. I’m on Excel 2011 for Mac, though, and what happens with this is that the other lines of text seem to vanish in the air. Can’t find any trace of the text after the first line.

    Reply
  3. If I could reach through this computer I’d kiss you !! This is EXACTLY what I was looking for! Thank you !!

    Reply
  4. Awesome, thanks so much! Just want to highlight that Harry Potter’s address is actually, 4 Privet Drive 😉

    Reply
  5. I’m workind on a Apple Computer… using Excel 2001…. the shortcut “control+J” isn’t working… do you the shortcut for an apple keyboard ?
    thanks for help !

    Reply
    • The shortcut Cmd+J does not work on Mac, but Ctrl+J does, in Excel 2011. However the dataset gets truncated after the first line.

      Reply
  6. See image:
    I want to break out the ID type so that only the “26” lines are left and have the information that lines up in MPI ID be the only thing that is displayed.(basically get rid of anything other than “26” in the ID Type Is this possible? Once this is accomplished then I would like to have that remaining information populated back into their columns with line breaks so that it will correspond with the first 2 columns.
    https://uploads.disquscdn.com/images/f7e1f62d63579e88fab78241ba8ac1e0e9335ed08e76c41a90c8d26f5296aa03.jpg

    Reply
  7. I want to only see “26” and it’s corresponding information in the next column. (see image)
    How can I accomplish this? Also how do I then take only the “26” information and put it back into 1 cell? This is a merged cell with line breaks in each column and since there is other data in the 1st 2 columns that I would also need to keep as a reference.I appreciate your help
    https://uploads.disquscdn.com/images/f7e1f62d63579e88fab78241ba8ac1e0e9335ed08e76c41a90c8d26f5296aa03.jpg

    Reply
  8. Hands down the best procedure I’ve found for converting multiple Lines in a cell into separate cells / columns

    Reply

Leave a Comment

Free-Excel-Tips-EBook-Sumit-Bansal-1.png

FREE EXCEL E-BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster

Free-Excel-Tips-EBook-Sumit-Bansal-1.png

FREE EXCEL E-BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster

Free Excel Tips EBook Sumit Bansal

FREE EXCEL E-BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster