[英]Excel - if cell contains text in a list then return value of another cell
I have 3 columns:我有 3 列:
A - Lookup item A - 查找项
B - List B - 清单
C - Link C-链接
D - formula goes here D - 公式在这里
I want to search column B for the text in each cell in column A.我想在 B 列中搜索 A 列中每个单元格中的文本。
For example, A2="bread" and with column B it has B2="some bread" and would return TRUE.例如,A2="bread" 并且对于 B 列,它具有 B2="some bread" 并且将返回 TRUE。 If it's TRUE, then I want to return the value in C2="abc".
如果它是 TRUE,那么我想返回 C2="abc" 中的值。
Another example, A3="eggs" and B3="egg" would return FALSE.另一个示例,A3="eggs" 和 B3="egg" 将返回 FALSE。 But B4="eggs" and would return TRUE, then I want to return value in D3="ghi".
但是 B4="eggs" 并且会返回 TRUE,那么我想在 D3="ghi" 中返回值。
Here's an image to illustrate:这是一张图片来说明:
I can find the word in column A to any in the list in column be with this formula:我可以使用以下公式在列的列表中找到 A 列中的任何单词:
=if(countif($B$2:$B$6,"*"&A2&"*")>0,true,false)
But I can't get the right mix of INDEX and MATCH to return the contents in column C when needed.但是我无法正确组合 INDEX 和 MATCH 以在需要时返回 C 列中的内容。 I think I need a mix of INDEX with ROW instead of MATCH.
我想我需要混合使用 INDEX 和 ROW 而不是 MATCH。
The issue with MATCH is the 3rd argument is [match_type] which is "1= exact or next smallest(default)", "0=exact match", "-1 = exact or next largest". MATCH 的问题是第三个参数是 [match_type],它是“1= 精确或次小(默认)”、“0=精确匹配”、“-1 = 精确或次大”。
Version: Excel 2016 (also would like it to work in Google Sheets but not required)版本:Excel 2016(也希望它可以在 Google 表格中使用,但不是必需的)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.