使用regexreplace从Google表格查询中过滤掉电话号码?

时间:2016-08-07 16:51:08

标签: google-sheets

我使用此查询公式list of number

=query(uploadData!A:M,"Select B, C, H, I, M where not(C) contains '"&JOIN("|",filter!A:A)&"' and  B contains 'Incoming' and not B is null and not H is null ",1)

您可以看到我正在尝试过滤结果,以便不包含filter!A:A中找到的任何匹配数字。但是,它不喜欢结果和过滤表使用电话号码格式(###) ###-####

我相信使用regexreplace将有助于解决此问题,但我对regexreplace知识如何合并它知之甚少。

谁能告诉我如何实现这一目标?

1 个答案:

答案 0 :(得分:0)

我不确定,谷歌工作表查询将管道|理解为OR逻辑,所以你可以改为使用这个公式:

=query(uploadData!A:M,"Select B, C, H, I, M where not C contains '"&JOIN("' and not C contains '",filter(filter!A2:A,filter!A2:A<>""))&"' and B contains 'Incoming' and not B is null and not H is null ",1)

我使用JOIN("' and not C contains '",filter(filter!A2:A,filter!A2:A<>""))

  • join + "' and not C contains '"逐一获取所有条件
  • filter(filter!A2:A,filter!A2:A<>"")只有空单元格