【发布时间】:2020-03-25 18:41:12
【问题描述】:
我正在使用 Google 表格,并且有两张表格,表格 1 和表格 2。我想查看 Sheet1 中的某个单元格是否包含 Sheet2 中 A 列的值。匹配应通过通配符*value* 完成。如果匹配,则应检索 B 列(表 2)中的相应值。
Sheet2 如下所示: 两列,A 列是我要搜索的内容,B 列是我要在匹配时返回的内容。
| Search | Return |
|:---------------------|:--------------|
| dog | Dog |
| hound | Dog |
| juice | Beverage |
| cola | Beverage |
Sheet1 如下所示,A 列包含不同事物的名称,B 列包含 google sheet 公式。
| Name | Type |
|:---------------------|:--------------|
| Coca-Cola | {formula} |
| Nuka-Cola | {formula} |
| Slurp Juice | {formula} |
| Dog | {formula} |
| Cola Juice | {formula} |
| Doggo | {formula} |
| Doge | {formula} |
| American Foxhound | {formula} |
| Mountain Dog | {formula} |
| The Hound | {formula} |
Sheet1 最终应如下所示,请参见 B 列。
| Name | Type |
|:---------------------|:--------------|
| Coca-Cola | Beverage |
| Nuka-Cola | Beverage |
| Slurp Juice | Beverage |
| Dog | Dog |
| Cola Juice | Beverage |
| Doggo | Dog |
| Doge | Dog |
| American Foxhound | Dog |
| Mountain Dog | Dog |
| The Hound | Dog |
这远远超出了我的谷歌表格公式技能。现在我在 Sheet1 中有以下公式,它以前做过类似的事情 - 但现在根本不起作用:
=LOOKUP(2^15;SEARCH(Sheet2!A:A;*A2*);Sheet2!B:B.
如果可能,我不想为此使用绝对引用,因为我不知道 Sheet2 有多长。
【问题讨论】:
标签: regex google-sheets google-sheets-formula array-formulas gs-vlookup