Search code examples
arraysgoogle-sheetstransposeflattengoogle-query-language

Combine rows of varying length google sheets


enter image description here

How can I combine rows of varying length like above?

I want a function, that can combine rows 1-4 and end up with one row with all the values like row 6


Solution

  • use:

    =TRANSPOSE(QUERY(FLATTEN(A1:C4); "where Col1 is not null"; 0))