Moving 2 column into rows, when data from first column should be grouped

paulusek

New Member
Joined
Apr 22, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
How to move data from 2 columns into matrix, when data from 1st column should be grouped? I do know have any power tools, basic XLS only.
Thanks a lot for support!
 

Attachments

  • Matrix with grouped column.png
    Matrix with grouped column.png
    24.6 KB · Views: 7

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi & welcome to MrExcel.
How about
Fluff.xlsm
ABCDEFGHI
111101
2111021112131415
311103101109113115117
411104102110114116118
511105103111119
611106104112120
711107105121
811108106122
912109107123
1012110108
1112111
1212112
1313113
1413114
1514115
1614116
1715117
1815118
1915119
2015120
2115121
2215122
2315123
24
Master
Cell Formulas
RangeFormula
E2:I10E2=LET(u,UNIQUE(FILTER(A1:A40,A1:A40<>"")),m,MAX(COUNTIFS(A:A,u)),DROP(REDUCE("",u,LAMBDA(x,y,HSTACK(x,EXPAND(VSTACK(y,TOCOL(FILTER(B1:B40,A1:A40=y))),m+1,,"")))),,1))
Dynamic array formulas.
 
Upvote 0
As an alternative you could do the same with Power Query


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Column1"}, {{"Count", each _, type table [Column1=number, Column2=number]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn([Count],"Index",1,1)),
    #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Count"}),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Column2", "Index"}, {"Column2", "Index"}),
    #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Expanded Custom", {{"Column1", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Expanded Custom", {{"Column1", type text}}, "en-US")[Column1]), "Column1", "Column2"),
    #"Removed Columns1" = Table.RemoveColumns(#"Pivoted Column",{"Index"})
in
    #"Removed Columns1"
 
Upvote 0

Forum statistics

Threads
1,224,847
Messages
6,181,337
Members
453,032
Latest member
Pauh

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