Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 注册表匹配if、and和日期组合forumula_Regex_If Statement_Google Sheets_Google Sheets Formula_Array Formulas - Fatal编程技术网

Regex 注册表匹配if、and和日期组合forumula

Regex 注册表匹配if、and和日期组合forumula,regex,if-statement,google-sheets,google-sheets-formula,array-formulas,Regex,If Statement,Google Sheets,Google Sheets Formula,Array Formulas,我需要帮助找出一个组合公式 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中的文本是

我需要帮助找出一个组合公式

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中的文本是“绿色”和/或“黄色”,那个么所有这些单词都可以被替换)

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

=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"))
然而,我对谷歌表单上的编码工作还不熟悉,我想我可以自己添加到这个公式中,而不会打扰其他人

有没有什么方法可以添加到这个公式中

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

将其粘贴到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(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"))