Kenneth Poulsen
Kenneth Poulsen

Reputation: 949

Query all sheets in a Google Spreadsheet to get all data into a single Sheet

I have a Google Spreadsheet containing some sheets with data. All sheets have the same amount of columns, and the same "data type".

Link to spreadsheet: https://docs.google.com/spreadsheets/d/1Yif8Cf1g1pPI38YFCffDKQ1tE-08SWPSfRAv-TdWXTw/edit#gid=0

It's the first column in the first sheet (all) that I can’t get to work.

This is what I have now, but it only fetches the first sheet:

=QUERY({mc!A2:E;bwl!A2:E;zg!A2:E},"select *")

The function looks okay?

Upvotes: 0

Views: 1060

Answers (1)

MattKing
MattKing

Reputation: 7773

if you scroll way down, you'll see that you ARE actually getting all the other sheets, you're just also getting all the empty rows. You just need to add "where Col1 is not null" to your query string like this:

=QUERY({mc!A2:E;bwl!A2:E;zg!A2:E},"select * where Col1 is not null")

That will pull out the blank rows.

Upvotes: 2

Related Questions