I have table like this. In real life it will be have more than 1000 rows.
Client | Group -------------- Merry | A Merry | C Susan | B Mike | C Susan | A Joe | A Tom | B Tom | C
And I have list of all clients which is filled from Google Form. I want to fill Group column with groups of every client using only arrayformula in the first row. My desired output is this:
Name | Groups ---------------- Joe | A Tom | B, C Mike | C Merry | A, C Susan | A, B Peter |
My best result yet is this:
Name | Groups | | | | | | | | ---------------------------------------------- Joe | | | | | | A | | | Tom | | | | | | | B | C | Mike | | | | C | | | | | Merry | A | C | | | | | | | Susan | | | B | | A | | | | Peter | | | | | | | | |
Looks like it does what I want but I can't join all these columns into one. Formula is:
=ArrayFormula(IF(name<>"";IF(name=TRANSPOSE(FILTER(client;LEN(client)));TRANSPOSE(FILTER(group;LEN(group))););))
I used "name", "client" and "group" as named ranges according to column headers.
Sample sheet is here (view only): https://docs.google.com/spreadsheets/d/1VFnmyDTQhlCaANAvkzLgzKRKchPsGzFn4hDZYOoJF_M/edit?usp=sharing