Split Rows?

beagleton

New member
Joined
Jun 28, 2017
Messages
26
Reaction score
0
Points
0
Hello All,

I have a spreadsheet where there are numbered lists in individual cells. It looks like this:

NumberNameIssue
1Name A1. Issue A1
2. Issue A2
3. Issue A3
2Name B1. Issue B1
2. Issue B2
3. Issue B3
3Name C1. Issue C1
2. Issue C2
3. Issue C3


What I would like to do is:

NumberNameIssue
1Name AIssue A1
2Name AIssue A2
3Name AIssue A3
4Name BIssue B1
5Name BIssue B2
6Name BIssue B3
7Name CIssue C1
8Name CIssue C2
9Name CIssue C3


Does anyone know how to do this/ if this is possible? Any help is appreciated.
Brendan
 
Hey Brendan,

Right click the Issue column --> Split by Delimiter
Split at custom
Expand the Advanced options and choose to split into Rows
Check the box for special characters

You may need to use the LineFeed or the Carriage Return, but one of them should work.

Code:
let    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Number", Int64.Type}, {"Name", type text}, {"Issue", type text}}),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Issue", Splitter.SplitTextByDelimiter("#(lf)", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Issue"),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Issue", type text}})
in
    #"Changed Type1"
 
As an interesting side note, the "split into rows" option is not present in Excel 2010. the M still works even without this option. I see it present in 2016 though
 
Back
Top