Home > OS >  Copy/pasting query in Google Sheets between cells with automatic replacement of values
Copy/pasting query in Google Sheets between cells with automatic replacement of values

Time:12-26

I have this query in my sheet: =query(A2:A100, "Order by A Desc Limit 20")

I want to copy and paste it to more cells and expect it will update range and column from A2:A100 to B2:B100, C2:C100 etc.. and A in query to B, C etc.

=query(B2:B100, "Order by B Desc Limit 20")

=query(C2:C100, "Order by C Desc Limit 20")

But when I copy/paste, it only updates range, but not query. How to implement it?

CodePudding user response:

use:

=SORTN(A2:A100; 20; 1; 1; 0)

CodePudding user response:

use this instead for copy-pasting w/no issues:

=query({A2:A100}, "Order by Col1 Desc Limit 20")
  • Related