Extract Lines into Separate Rows

pto160

Well-known Member
Joined
Feb 1, 2009
Messages
505
Office Version
  1. 365
Platform
  1. Windows
I am on the latest Excel 365. How can I extract lines into separate rows? Some lines will have a different number of lines, Some for example will have 3, 2 or 1.
Book1
A
1Dog Cat Snake
2Boat Car
3House
4
5What I like
6
7Dog
8Cat
9Snake
10Boat
11Car
12House
Sheet1
 
try this one please

Let Function - Split Col and Group by Sum row^Mcol.xlsx
O
62Dog Cat Snake
63Boat Car
64House
65
66Result
67Dog
68Cat
69Snake
70Boat
71Car
72House
Test
Cell Formulas
RangeFormula
O67:O72O67=VSTACK(TRANSPOSE(TEXTSPLIT(O62,CHAR(10))),TRANSPOSE(TEXTSPLIT(O63,CHAR(10))),TRANSPOSE(TEXTSPLIT(O64,CHAR(10))))
Dynamic array formulas.
 
Upvote 0
Try the simpler ..

25 02 08.xlsm
A
1Dog Cat Snake
2Boat Car
3House
4
5What I like
6
7Dog
8Cat
9Snake
10Boat
11Car
12House
pto160
Cell Formulas
RangeFormula
A7:A12A7=TEXTSPLIT(TEXTJOIN(CHAR(10),1,A1:A3),,CHAR(10))
Dynamic array formulas.
 
Upvote 0
Thank you so much to everyone for your help. These solutions work great. This will save me a lot of time. :) (y)
 
Upvote 0
You're welcome. Glad we could help. Thanks for the follow-up. :)


These solutions work great.
The first one would be a bit onerous if the original data was 100 rows though! :eek:

Having said that, if your data is very large, mine could fail as TEXTJOIN has a limit of 32,767 characters.
 
Upvote 0
One more option is with Power Query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Column1", Splitter.SplitTextByDelimiter("#(lf)", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Column1")
in
    #"Split Column by Delimiter"
 
Upvote 0
alansidman, thanks so much for the power query option as well. (y) :)
 
Upvote 0

Forum statistics

Threads
1,226,771
Messages
6,192,919
Members
453,767
Latest member
922aloose

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