While entering or editing data in Excel it is possible to add line breaks in the cell using Alt + Enter. This can be a convenient way to display data in Excel, but is often not great for any type of data analysis.
For example, it might be more convenient for the reader to display an address in a cell like this:
John MacDougall
123 Fake Street
Any Town
Canada
Rather than like this:
John MacDougall, 123 Fake Street, Any Town, Canada
In this post I’ll show you how to separate the data in your cells based on the in-cell line breaks. This can be useful when doing any sort of data analysis on the data. In this example, we have address data which includes a person’s name, address, city and country. The data is in one cell for each person but the name, address, city and country are on different lines.
Select your data and open the Text to Columns wizard.
- Select all the data containing multiple in-cell lines which you want to convert into single line cells.
- Go to the Data tab in the ribbon.
- Select Text to Columns in the Data Tools section.
Text to Columns wizard step 1.
- Select Delimited option under Original data type.
- Press the Next button.
Text to Columns wizard step 2.
- Select Other from the Delimiters options and deselect all the rest of the options. In the input box to the right of Other press Ctrl + J to insert a line break as your delimiter.
- You should see dividers appear in the Data preview pane where there are line breaks in your data.
- Press the Next button.
Text to Columns wizard step 3.
- Use the range selector icon to choose a destination for the divided data. Select a cell outside of the original data range to keep a copy of the original data.
- Check the Data preview to make sure the text to column is correct.
- Press the Finish button.
Now each line from the original data is in its own column allowing for easier analysis of the different data fields using pivot tables, formulas or other tools!
0 Comments