Forum Discussion
Column headings to rows - changing my list
- Oct 18, 2017
Hi Sheena,
Do you mean the information in these columns is only in rows with 5 digits numbers and in resulting table that is to be in the rows against same 5 digits?
Hi Sheena,
Perhaps the easiest way is to use Power Query (Get&Transform in Excel 2016), that looks like
and the script generated from user interface is
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
AsNumbers = Table.TransformColumnTypes(Source,{{"Numbers", Int64.Type}}),
OnlyNumbers = Table.SelectRows(AsNumbers, each ([Numbers] <> null)),
#"4Digits" = Table.AddColumn(OnlyNumbers, "4Digits", each if [Numbers] < 10000 then [Numbers] else null),
NullToNumber = Table.FillDown(#"4Digits",{"4Digits"}),
#"5Digits" = Table.AddColumn(NullToNumber, "5digits", each if [Numbers] >= 10000 then [Numbers] else null),
NoNulls = Table.SelectRows(#"5Digits", each ([5digits] <> null)),
RemoveSourceColumn = Table.RemoveColumns(NoNulls,{"Numbers"})
in
RemoveSourceColumnWith formulas - perhaps also possible, but better to know how exactly your data is structured.
- Sheena PunkOct 18, 2017Copper Contributor
Wonderful! Thank you!
Next question is; will the information that I have in colums B to P (because I have a lot of information on each row) remain connected to th five digit numbers using this method?
- SergeiBaklanOct 18, 2017Diamond Contributor
Hi Sheena,
Do you mean the information in these columns is only in rows with 5 digits numbers and in resulting table that is to be in the rows against same 5 digits?
- Sheena PunkOct 23, 2017Copper Contributor
Yes, perfect! Thank you so much!! You made mye day!