根据datediff过滤字符串中的日期?

问题描述 投票:0回答:1

我有一个过滤器计算,我想在其中引入“主行列表”工作表中的列。计算的第一次迭代有效,但我附加了逻辑来搜索 C 列中的行。找到第一个日期值,如果是 <= 7 days from today, then bring in the matching data from the rest of the column. If the first date found is older than that then don't bring data in.

=IFNA(UNIQUE(FILTER({'Master Line List'!C:C,'Master Line List'!F:F,'Master Line `List'!E:E,'Master Line List'!G:G},`

 (ISNUMBER(SEARCH(TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(TODAY())-7),"mm/dd/yyyy"), 

'Master Line List'!C:C))), 'Master Line List'!E:E=C1, 'Master Line List'!G:G=D1)),"")

因此,根据“指标”表,我选择 c1 下拉菜单 = Dan 和 d1 下拉菜单 = Outreach。如果您进入“主行列表”,您可以看到 G 列有 4 行具有 Dans 名称,但其中只有 2 行在 F 列中具有日期,该日期距离今天一周或更短。

我需要更改什么才能引入正确的行?

工作簿链接

google-sheets
1个回答
0
投票

您可以尝试:

=filter(choosecols('Master Line List'!C:G,1,4,3,5),
         'Master Line List'!G:G=C1,'Master Line List'!E:E=D1,
          isbetween(ifna(--regexextract('Master Line List'!F:F,"\d{1,2}/\d{1,2}/\d{2,4}")),today()-7,today()))

© www.soinside.com 2019 - 2024. All rights reserved.