0

I have a formula that queries two sheets in the document and pulls data to a third sheet. If I add new data to the first sheet after the query has completed and then go back to the third sheet (with the query results) the new data is not at the bottom of the combined list. It is at the bottom of the first section. The data sourced from the different sheets is kept together, all first then all second.

Is there a way to enforce sorting the entire output collectively by a particular column (preferably ColumnF)?

Spreadsheet with sample data here.

enter image description here

pnuts
  • 58,317
  • 11
  • 87
  • 139
Overlordchin
  • 185
  • 3
  • 3
  • 13

1 Answers1

0

Please try:

=sort(ARRAYFORMULA({QUERY(Sheet1!A1:I500, "Select * where G = 'no'", 0); (QUERY(sheet2!A1:I500, "Select * where G = 'no'", 0))}),6,1)
pnuts
  • 58,317
  • 11
  • 87
  • 139
  • Thanks again pnuts. I tried to learn from last time and put the example in right away. I hope my question was better phrased this time? – Overlordchin Feb 15 '15 at 00:08
  • Looks like if I remove the sample data it starts to break. If one of those queries returns null it throws an error and responds with #VALUE I tried wrapping an iferror around it and having it use an empty string if there is an error. I also tried a 0. if you put a no on the 2nd sheet and then check the query sheet you can see results. Take away the no from sheet2 and the query results changes to #VALUE – Overlordchin Feb 15 '15 at 00:45
  • Note that if I take a single one of those fomulas out: `=iferror(QUERY(sheet2!A1:I500, "Select * where G='no'", 0), 0)` and use a 0 or an empty string it works just fine. however when put in the array formula it throws the #VALUE error – Overlordchin Feb 15 '15 at 00:52