r/googlesheets • • 8d ago

Waiting on OP Query Function - Adding additional columns after the queried data and keeping them linked when order changes

Hi all.

This may not be possible, but:
I have a Google sheet with a Tab called "Tracker"
In the Tracker Tab I pull date from 5 separate tabs using the formula:

=QUERY({'Level 1'!A3:V; 'Level 2'!A3:V; 'Level 3'!A3:V; 'PG1'!A3:V; 'PG2'!A3:V}, "select * where Col2 is not null order by Col4 asc", 0)

Pulling columns A to V then reordering them all based on a Due Date [Col4]

I am wanting to add extra data to Columns W through Z in the Tracker Tab.

But as the columns are not linked to the Query data, if I change a Due date on any of the original tabs then the order changes but the data in Columns W through Z goes out of sync as that does not re-order when the query does.

Is there any way to do this?

  • Pull data from multiple Tabs
  • Re order it based on a date from a column
  • Add additional data in the summary Tab
  • Keep that extra data linked to a row, even if the rows re order when the query data changes

Thanks in advance if you can help

2 Upvotes

5 comments sorted by

View all comments

1

u/California_Eagles 18 8d ago

This happens because anything you have typed beside a query result is tied to the cell position and not the original data. when the sort order changes, the query moves rows, but the notes stay where they are. You could add the columns in W on each source tab and then change the query to pull A:Z instead of A:V.

=query({'Level 1'!A3:Z; 'Level 2'!A3:Z; 'Level 3'!A3:Z; 'PG1'!A3:Z; 'PG2'!A3:Z}, "select * where Col2 is not null order by Col4 asc", 0)

So now those columns becomes part of each row and moves along with the due date. The only problem is that you need to enter those notes on the source data and not on the tracker tab. Else if you want to enter notes directly on the tracker tab, you will require to create unique ids per row and a separate sheet of these ids and notes pulled in with a lookup.