【问题标题】:Regematch if, and, and date combined forumulaCagematch if, and, and date 组合公式
【发布时间】:2019-12-10 16:39:38
【问题描述】:

我需要帮助来找出一个组合的谷歌表格公式

If 
    Cell B5 contains "Rct"
And
    today's date is 30 days after the date defined in cell C5
And
    if Cell D5 and D6 both says "2 weeks ago" or "1 week ago" or contains the words "day" "hour" or "minute"

(不确定是否可能,但如果单元格 D5 和 D6 中的文本颜色为“绿色”和或“黄色”,则所有这些词都可以代替)

Then
    Cell H5 will say "Y" if the above conditions are met or "N" if they aren't

以下公式适用于我上面的问题

=ARRAYFORMULA(IF((REGEXMATCH(LOWER(B5:B29), "rct"))*
             (TODAY()>C5:C29+30)*
             (REGEXMATCH(LOWER(D5:D29), "2 weeks ago|1 week ago|day|hour|minute"))*
             (REGEXMATCH(LOWER(E5:E29), "2 weeks ago|1 week ago|day|hour|minute")), 
             "Y", "N"))

但是,我对在 google 表格上进行这种编码工作很陌生,尽管我可以自己添加到该公式中而不会打扰其他人。

有什么办法可以添加到那个公式中

If
    Cell B5:B28 contains "cdt"
and
    today's date is 60 days after the date defined in cell F5:F29
And
   if Cell D5 and D6 both says "2 weeks ago" or "1 week ago" or contains the words "day" "hour" or "minute"
Then
    Cell H5 will say "Y" if the above conditions are met or "N" if they aren't

还有

If
   Cell B5:B28 contains "pvt"
and
   today's date is 90 days after the date defined in cell F5:F29
And
   if Cell D5 and D6 both says "2 weeks ago" or "1 week ago" or contains the words "day" "hour" or "minute"
Then
    Cell H5 will say "Y" if the above conditions are met or "N" if they aren't

【问题讨论】:

  • 与所需输出的示例共享您的工作表副本

标签: regex if-statement google-sheets google-sheets-formula array-formulas


【解决方案1】:

将其粘贴到 H5

=ARRAYFORMULA(IF((REGEXMATCH(LOWER(B5:B), "rct"))*
                 (TODAY()>C5:C+30)*
                 (REGEXMATCH(LOWER(D5:D), "2 weeks ago|1 week ago|day|hour|minute"))*
                 (REGEXMATCH(LOWER(E5:E), "2 weeks ago|1 week ago|day|hour|minute")), 
                 "Y", "N"))

更新:

=ARRAYFORMULA(IF((((REGEXMATCH(LOWER(B5:B), "rct"))*(TODAY()>C5:C+30))+
                  ((REGEXMATCH(LOWER(B5:B), "cdt"))*(TODAY()>C5:C+60))+
                  ((REGEXMATCH(LOWER(B5:B), "pvt"))*(TODAY()>C5:C+90)))*
                   (REGEXMATCH(LOWER(D5:D), "2 weeks ago|1 week ago|day|hour|minute"))*
                   (REGEXMATCH(LOWER(E5:E), "2 weeks ago|1 week ago|day|hour|minute")),
                   "Y", "N"))

【讨论】:

    猜你喜欢
    • 2021-04-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多