简体   繁体   中英

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

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?

use:

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM