【问题标题】:Google Sheets filter out emails based only on the email domainGoogle 表格仅根据电子邮件域过滤掉电子邮件
【发布时间】:2026-01-04 16:40:02
【问题描述】:

我想根据要过滤掉的电子邮件域列表,从 google sheet 电子邮件列表中过滤掉所有具有特定域(如@yahoo.com)的电子邮件。

假设Sheet1 看起来像这样(我要过滤的列表):

tod     bose    tbose@sink.com  
william small   wsmall@sink.com 
Kafka   snail   ksnail@sink.com 
John    Bose    Jbose@sink.com  
Aug     Smith   asmith@yahoo.com
Aaron   Moog    amoog@googol.com

Sheet2 看起来像这样(排除过滤条件(我想从Sheet1 的列表中排除这些)):

*@sink.com
*@yahoo.com

Sheet3 正在使用这样的标准 Google 表格过滤器:

=filter(Sheet1!A1:C5, ISNA(match(Sheet1!C1:C5,Sheet2!C1:C11, 0)))

过滤后的Sheet3(过滤器没有工作)看起来像这样(这应该显示过滤后的列表):

tod     bose    tbose@sink.com  
william small   wsmall@sink.com 
Kafka   snail   ksnail@sink.com 
John    Bose    Jbose@sink.com  
Aug     Smith   asmith@yahoo.com
Aaron   Moog    amoog@googol.com    

我该怎么做才能解释通配符/或做类似的事情?我实际上如何仅根据域排除所有电子邮件?

我尝试了=filter(Sheet1!A1:C5, search(Sheet2!C1:C5,Sheet1!C1:C5))(并删除了*,但无济于事。

**编辑:我想在这里只留下 googol 电子邮件,我想过滤掉 Sheet2 上的域。

这是 Google 表格: https://docs.google.com/spreadsheets/d/1R08Srsal54hH42VgM7AJ2mAMYRKNOONLD2Yvzf3n__g/edit?usp=sharing

谢谢。

【问题讨论】:

    标签: arrays regex google-sheets filter google-sheets-formula


    【解决方案1】:

    尝试:

    =FILTER(A1:C, REGEXMATCH(C1:C, ".*@sink.com|.*@yahoo.com"))
    


    反向:

    =FILTER(A1:C, A1:A<>"", NOT(REGEXMATCH(C1:C, ".*@sink.com|.*@yahoo.com")))
    

    【讨论】:

    • 谢谢。我想在这里只留下 googol 电子邮件,我想过滤 Sheet2 上的域。我可以在某处用感叹号反转吗?此外,排除列表可能会增加。
    • 我试过这个=FILTER(A1:C, NOT(REGEXMATCH(C1:C, ".*@sink.com|.*@yahoo.com"))) 但我得到了错误Error Circular dependency detected. To resolve with iterative calculation, see File &gt; Spreadsheet Settings.
    • @AgentZebra 你能分享一份你的工作表吗?
    • 哦,等等,当我尝试=FILTER(Sheet1!A1:C, (NOT(REGEXMATCH(Sheet1!C1:C, ".*@sink.com|.*@yahoo.com")))) 时,该错误消失了,但它不排除,我只是得到一张空纸
    • @AgentZebra | 表示正则表达式中的 OR,&lt;&gt; 用于排除空行
    最近更新 更多