# How to combine two QUERY results into one column

I have the following `QUERY`

``````=query(XX!A2:A;" select A where A>'50' ")
``````

and

``````=query(YY!A2:A;" select A where A>'50' ")
``````

how do I combine these two data sources so I don't have to have two separate columns they process data to?

• best would be if the 1st row from `XX` is followed by the 1st row of `YY`, 2nd row followed by 2nd row... and so on
• If the above option is not easily possible, it is OK for one query to be followed by the second one (if I expect correctly that the start of the second will be moved with newly added data into the first one)

the most easier is to do:

``````={QUERY(XX!A2:A; "select A where A>'50'");
QUERY(YY!A2:A; "select A where A>'50'")}``````

``````={QUERY(XX!A2:A; "select A where A is not null");
QUERY(YY!A2:A; "select A where A is not null")}``````

to zip 2 queries you can do:

``````=QUERY({{ARRAYFORMULA(ROW(INDIRECT("A1:A"&COUNTA(QUERY(XX!A2:A;
"select A where A is not null")))))\QUERY(XX!A2:A;
"select A where A is not null")};
{ARRAYFORMULA(ROW(INDIRECT("A1:A"&COUNTA(QUERY(YY!A2:A;
"select A where A is not null")))))\QUERY(YY!A2:A;
"select A where A is not null")}};
"select Col2 order by Col1 asc")``````

• This results in error: `Function 2 parameter ARRAY_ROW has unexpected row dimension. Expected size: 545. real size: 413.` – Marek Marhoul Feb 27 '19 at 12:17
• are these two queries from the same sheet? – user0 Feb 27 '19 at 12:18
• yes. But in the end I might not need that >50 functionality so basically I just need to combine two lists of IDs from those two sheets into one bigger list that automatically expands once I add new IDs in any of those two sheets – Marek Marhoul Feb 27 '19 at 12:19
• can you share a copy of that sheet? – user0 Feb 27 '19 at 12:20
• link – Marek Marhoul Feb 27 '19 at 12:29