Google-sheets – Query Function Not Putting Consolidated Data in the Right Place

formulasgoogle sheetsgoogle-sheets-queryworksheet-function

So I don't know how to explain this completely, but basically, I'm using the query function to consolidate data from multiple sheets into one Master Sheet. The function itself seems to be working fine and all the data from the other sheets ends up on the Master Sheet.

HOWEVER…

Instead of the data being added vertically so that the number of rows increases, the data is being added horizontally. A picture is attached to explain this better. Basically, it's "copying and pasting" the data from the other sheets into the next COLUMN over instead of the next row.

enter image description here

Best Answer

Instead of , in your formula, use ; - this will stack the queries under each other:

={QUERY(Sheet1!A:B); QUERY(Sheet2!A:B)}

Also, you may want to wrap it all in outer QUERY to get rid of the empty rows:

=QUERY({QUERY(Sheet1!A:B); QUERY(Sheet2!A:B)}, "where Col1 is not null", 0)

(for EU locale use \ instead of ;)