Search code examples
arraysgoogle-sheetsgoogle-sheets-formulatransposegoogle-sheets-query

Stack multiple columns into one without ignore blank cells


For a stack of several columns and filtering the blank cells, @player0 told me to do it as follows:
https://stackoverflow.com/a/60028660/11462274

But I came across the need for the blank cells not to be ignored, because I'm going to use a script on four different spreadsheets, and each one of them will send data to the first blank row of the columns, so it may happen that some columns have more data than the others and as I am going to record values manually in the column on the side, if I change the positions it will mess up what I record manually.

:

A B C D
E F G H
  J K L
  N    

Expected result:

A
B
C
D
E
F
G
H

J
K
L

N


These blank spaces will be necessary so that when new data is recorded in the columns, the old ones do not change position, remain in the same place where they are.

Would it be possible to do that?

Note: I have already looked in some places saying that if I do this, the spreadsheet would be immense because of the number of blank lines that it would take into account. I imagine that it would be necessary only the blank cells until the last line that has data at the moment, the rest would not be necessary.

But I was unable to adjust to make this possible.


Solution

  • My solution is so simple it hurts, but you can use =FLATTEN(A1:D)

    Yes, that easy.

    Apparently, Google never documented this FLATTEN function, but it works PERFECTLY for what you want and what I've needed as well.

    Hope someone finds this even though it's been answered, I know I've needed it forever haha.