I'm currently working with a table of student scores for different tests (denoted in columns A2 through E2) that I need to transpose and assign certain values to certain numbers.
Essentially, I have one column in a table that reads 0-7 (Cell A3) and another value in column F3 that indicates the number to be assigned to that range.
I would need a way to transpose cell A3 so it splits into single digits from 0 through 7 (as opposed to being a range in one cell). I would then need to assign a 1 to that spread of numbers 0 through 7.
Type Score 2 Type Score1 Score2 AA BB AA 0 10-7 0-5 1AA 1 18-10 6-7 2AA 2 111-14 8-9 3AA 3 115-19 10-11 4AA 4 120-24 12-13 5AA 5 125-29 14-15 6AA 6 130-35 16-18 7AA 7 136-40 19-20 8AA 8 241-44 21-22 9AA 9 245-48 23-23 10AA 10 249-53 24-25 11AA 11 354-56 26-26 12AA 12 357-58 27-28 13AA 13 359-60 29-29 14AA 14 361-62 30-30 15AA 15 463-63 31-31 16AA 16 464-64 32-32 17AA 17 465-65 33-33 18AA 18 466-66 34-36 19AA 19 4AA 20 5AA 21 5AA 22 5AA 23 5AA 24 5AA 25 6AA 26 6AA 27 6AA 28 6AA 29 6AA 30 7AA 31 7AA 32 7AA 33 7AA 34 7AA 35 7AA 36 8AA 37 8AA 38 8AA 39 8AA 40 8
and so on... green table is much longer so you'll need to test it yourself
Code:// Table1AA let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], Split = Table.SplitColumn(Table.RemoveColumns(Source,{"BB"}), "AA", Splitter.SplitTextByDelimiter("-", QuoteStyle.Csv), {"AA.1", "AA.2"}), Number = Table.TransformColumnTypes(Split,{{"AA.1", Int64.Type}, {"AA.2", Int64.Type}}), AA = Table.AddColumn(Table.AddIndexColumn(Number, "Score2", 1, 1, Int64.Type), "Type", each "AA"), Score1 = Table.AddColumn(AA, "Score1", each {[AA.1]..[AA.2]}), TSC = Table.SelectColumns(Table.ExpandListColumn(Score1, "Score1"),{"Type", "Score1", "Score2"}) in TSC // Table1BB let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], Split = Table.SplitColumn(Table.RemoveColumns(Source,{"AA"}), "BB", Splitter.SplitTextByDelimiter("-", QuoteStyle.Csv), {"BB.1", "BB.2"}), Number = Table.TransformColumnTypes(Split,{{"BB.1", Int64.Type}, {"BB.2", Int64.Type}}), BB = Table.AddColumn(Table.AddIndexColumn(Number, "Score2", 1, 1, Int64.Type), "Type", each "BB"), Score1 = Table.AddColumn(BB, "Score1", each {[BB.1]..[BB.2]}), TSC = Table.SelectColumns(Table.ExpandListColumn(Score1, "Score1"),{"Type", "Score1", "Score2"}) in TSC // Append1 let Source = Table.Combine({Table1AA, Table1BB}), Type = Table.TransformColumnTypes(Source,{{"Type", type text}, {"Score1", Int64.Type}, {"Score2", Int64.Type}}) in Type
Bookmarks