Search code examples
arraysgoogle-sheetsflatten

Flatten only non empty cells refrence range once


I have two columns A2:B with empty and non empty cells, I want to achive a similar result to the formula in D2 but refrence the range A2:B once in the formula. =Formula(Range)

=FILTER(FLATTEN(A2:B),FLATTEN(A2:B)<>"")

Make a copy of the example.

enter image description here


Solution

  • UPDATED! this is now much simpler with =TOCOL(A2:B,TRUE)

    Use

    =QUERY(FLATTEN(A2:B), " where Col1 is not null ",0)
    

    enter image description here