использование:
=ARRAYFORMULA(REGEXREPLACE(UNIQUE(ARRAY_CONSTRAIN({A3:A,
SUBSTITUTE(TRIM(TRANSPOSE(QUERY(TRANSPOSE(IF(A3:A=TRANSPOSE(A3:A),
TRANSPOSE(B3:B)&",", )),,ROWS(A3:A))))&"|", ",|", ),
SUBSTITUTE(TRIM(TRANSPOSE(QUERY(TRANSPOSE(IF(A3:A=TRANSPOSE(A3:A),
TRANSPOSE(C3:C)&",", )),,ROWS(A3:A))))&"|", ",|", )}, COUNTA(A3:A), 3)),
", ", ","))