How to combine multiple rows into single column, or multiple columns

How can I take multiple rows of different data for one user, and move them into columns so that each user has only one row.

In my example, I have three tables. The table in red is the current data I have. The tables in green are what I want to convert the data to.

I tried moving each value into its own column with a formula placing a formula in a different column and moving the data over like this: In C2, =IF B2=21, B2' then copying the data into one row and deleting the others. This is long and complicated process and I am wondering if there is a better way.

https://docs.google.com/spreadsheets/d/1utqqw1Am0C_x80t1BiswHmIdWzEhNDHq4vtdBOnkGMI/edit?usp=sharing

>Solution :

You may try:

1st table

=byrow(unique(tocol(A2:A,1)),lambda(z,{z,join(", ",filter(B:B,A:A=z))}))

2nd table

=byrow(unique(tocol(A2:A,1)),lambda(z,{z,torow(filter(B:B,A:A=z))}))

enter image description here

Leave a Reply