Deliminate data based on line breaks

ukmike007

New Member
Joined
Sep 17, 2012
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Hi All

I have been sent a large spreadsheet of data, that contains within a column a number of options. Each option is within an individual cell, separated by line breaks.

There are between 1 & 20 options on each row.

I need to text-to-columns or similar to split these into individual columns on the same line of the spreadsheet...

Example as below

Many thanks

Mike

E.g.

CurrentOutput
EntryPersonCityFruit OptionsFruit 1Fruit 2Fruit 3
1​
JohnOxfordOrange x 2
Apple x 1
Oranges x 2Apple x 1
2​
BillBirminghamGrapes x 2Grapes x 2
3​
SimonLondonLemons x 5
Strawberry x 7
Mango x 3
Lemons x 5Strawberry x 7Mango x 3
4​
MaryManchesterPear x 2
Apple x 1
Pear x 2Apple x 1
5​
AnneGlasgowOrange x 2
Melon x 3
Apple x 1
Orange x 2Melon x 3Apple x 1
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Are you happy to use Power Query ?

1628156502386.png


1628156540546.png
 
Last edited:
Upvote 0
I have not used power query before. Managed to find elsewhere that Control + J is the deliminator for line breaks, but would be interested in another solution as I need to next extract data from within the line breaks and analyse it.
 
Upvote 0
Have used table before ?
If so I assume that the word current is not in your original data.
(If it is insert a blank row under the word current)
Then click anywhere in your table and hit ctrl+T
Then still in the table on the right side of the menu click Table Design
Then on the left side there is a Table Name box it will mostly likely say Table1, type in something meaningful
(I used tblImport)

Still with the cursor inside the table.
Data > From Table/Range (far left)
You will now be in the Power Query editor
Select the Fruit Options column
Transform > Split Columns (about in the middle) > By Delimiter
Select the settings in the screenshot below and hit ok
Give the query a meaningful name

Home > Close and Load To > either select new worksheet or Existing worksheet and a location

Split
1628162059081.png


Close & Load To

1628162244615.png
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top