简体   繁体   English

Excel - 基于部分匹配的 VLOOKUP 返回

[英]Excel - VLOOKUP return based on partial match

I have two sheets.我有两张床单。 Sheet 2 contains keywords.工作表 2 包含关键字。 Sheet 1 contains some very long strings.工作表 1 包含一些很长的字符串。 Among the long strings, I need to find if there is match from the keyword on other page sheet 2.在长字符串中,我需要查找其他页面 2 上的关键字是否匹配。

Sheet 1:第 1 张:

工作表1

Sheet 2工作表 2

工作表2

I used Wildcard but retuning #N/A我使用通配符但重新调整#N/A

=VLOOKUP("*"&A2&"*",Sheet2:A,A,1,FALSE)

Try SEARCH() and FILTER() .试试SEARCH()FILTER()

=TEXTJOIN(", ",1,FILTER(Sheet2!$A$1:$A$3,ISNUMBER(SEARCH(Sheet2!$A$1:$A$3,A2))))

TEXTJOIN() for joining multiple keyword if any. TEXTJOIN()用于连接多个关键字(如果有)。

在此处输入图像描述

Perhaps you could try using the LOOKUP() Function也许你可以尝试使用LOOKUP() Function

在此处输入图像描述


• Formula used in cell B2 • 单元格B2中使用的公式

=LOOKUP(9^9,SEARCH($D$1,A2),$D$1)

If you have a list of keywords, and you want to return the one that matches, then try:如果您有一个关键字列表,并且想要返回匹配的关键字,请尝试:

=IFERROR(INDEX(KeyWords,AGGREGATE(15,6,1/ISNUMBER(FIND(KeyWords,A2))*ROW(KeyWords),1)),"")

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

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