简体   繁体   English

Google表格查询>根据字符串中的文本过滤行

[英]Google Sheets Query > Filter rows based on text in a string

I have a recipe database on Sheet1.我在 Sheet1 上有一个食谱数据库。 Each row is a recipe and each recipe has all of the ingredients listed in a single cell using JOIN in column B eg "Bread, Butter, Beans, Cheese".每一行都是一个食谱,每个食谱都在一个单元格中使用 B 列中的 JOIN 列出了所有成分,例如“面包、黄油、豆类、奶酪”。

On Sheet2, I have a client database.在 Sheet2 上,我有一个客户端数据库。 Each client has a list of dislikes, all of which are listed in a single cell, using JOIN eg "Sprouts, Celery, Fish".每个客户都有一个不喜欢的列表,所有这些都列在一个单元格中,使用 JOIN 例如“豆芽、芹菜、鱼”。

On Sheet3, I would like to have a filtered list of all the recipes that do not contain ingredients that the client dislikes.在 Sheet3 上,我想要一个过滤列表,列出所有不包含客户不喜欢的成分的食谱。 Using a dropdown, I would like to choose the client and then see what recipes they would like.使用下拉菜单,我想选择客户,然后看看他们想要什么食谱。

After hours of back and forth with Sheets, I've conceded this is way above my pay grade.在使用 Sheets 来回数小时后,我承认这远高于我的工资等级。

Could anyone put an end to this mystery for me?谁能为我解开这个谜团?

Here's a link to a demo sheet > Demo Sheet这是演示表的链接 > 演示表

try:尝试:

=FILTER(Sheet1!A2:B, NOT(REGEXMATCH(Sheet1!B2:B, 
 SUBSTITUTE(VLOOKUP(B1, Sheet2!A:B, 2, 0), ", ", "|"))))

0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM