используйте SUBSTITUTE
или REGEXREPLACE
формулы, завернутые в ARRAYFORMULA
, например:
=ARRAYFORMULA(SUBSTITUTE(your_formula_or_range_here, ";", CHAR(10))
=ARRAYFORMULA(REGEXREPLACE(your_formula_or_range_here, ";", CHAR(10))
пример:
=ARRAYFORMULA(SUBSTITUTE(QUERY({INDEX(QUERY(A1:B,
"select A,count(A) where A is not null group by A pivot B", 0), , 1),
REGEXREPLACE(TRIM(TRANSPOSE(QUERY(TRANSPOSE(IF(ISNUMBER(QUERY(A1:B,
"select count(A) where A is not null group by A pivot B", 0)), INDEX(QUERY({A1:A,B1:B&";"},
"select count(Col1) where Col1 is not null group by Col1 pivot Col2 offset 1", 0), 1,), ))
, , 999^99))), ";$", )}, "offset 1", 0), "; ", CHAR(10)))