Search code examples
google-sheetsgoogle-sheets-formula

Create transposed summary


I have a table starting from Column A in row 5:

table_number   name
 1             cathy
 3             sarah
 1             bob
               jake     (no table allocated so can ignore)

On a new sheet, how could I transform it so I can see it alphabetically in numerical order. (If two identical names are allocated to the same table, the name should show twice i.e. allow duplicates):

1        2        3
bob      ...     sarah
cathy

Solution

  • You may try:

    =map(torow(sequence(max(A5:A))),lambda(Σ,ifna(vstack(Σ,sort(filter(B:B,A:A=Σ))))))
    

    enter image description here