如何根据文件名中的日期导入范围



每天都有一个实时电子表格的滚动列表,文件名采用这种格式,"ranking_file-2022-10-05";。

我需要我的importrange查询总是获取今天的日期文件名,另一个总是获取7天前的文件名。这可能吗?任何帮助都将不胜感激。

这是我目前的查询,我需要基于上面的两个版本:

=SORTN(SORT(QUERY(IMPORTRANGE("xxxxx/edit","ranking_file!A2:O250"),"Select Col1,Col4,Col7,Col5,Col14,Col15 where Col5 contains 'xxxxx' and Col15 contains 'Google.co.uk_' and Col4 is not null order by Col4 asc", ), 3, 1), 9^9, 2, 2, 1)

try:

=SORTN(SORT(QUERY(
{IMPORTRANGE("xxxxx/edit","ranking_file-"&TEXT(TODAY(), e-mm-dd)&"!A2:O250")},
"select Col1,Col4,Col7,Col5,Col14,Col15 
where Col5  contains 'xxxxx' 
and Col15 contains 'Google.co.uk_' 
and Col4 is not null 
order by Col4 asc", ), 3, 1), 9^9, 2, 2, 1)

最新更新