Google-sheets – Automatically adjust corresponding cells when using “=query”

google sheets

I just learned how to use the =query function in Google Sheets, pulling information from one sheet to the next when a specific condition is met.

=query('Sheet1'!A:Z, "select B, D, E, F, G, I, L where A = 'WON'",0)

Example:

Sheet 1:

A AUG  WON
B SEPT PENDING
C SEPT LOST
D OCT  WON

Sheet 2:

A AUG
D OCT

In the second sheet, I add information in the columns after the ones =query pulled in, for example:

A AUG DANNY
D OCT NICKY

But when I change the source sheet, from PENDING to WON, it becomes this:

A AUG  DANNY
B SEPT NICKY
D OCT

How do I fix it so whatever information I put in the same row adjusts with the cells it was originally put with, leaving empty cells I can fill out beside the new entries?

Best Answer

The values added to the right of QUERY() result aren't "tied" to the source range.

To "tie" them, add these values to the source sheet, as was suggested in a comment posted by @pnuts.