简体   繁体   English

excel Vlookup部分匹配列表到列表

[英]excel Vlookup partial match list to list

Forgive the terrible Title. 原谅可怕的头衔。 I have a list of values like this 我有一个这样的值列表

SL- - - - - - - 
TP- - - - - - - 
AB- - - - - - - 
E5- - - - - - - 
AD- - - - - - - 
XP- - - - - - - 
MD- - - - - - - 
XH- - - - - - - 
MD- - - - - - - 
TP-TQ-TR- - - - - 
TQ-TN-TJ- - - - - 
TH- - - - - - - 
XH- - - - - - - 

I have an additional list like 我还有一个类似的清单

SL
XP
XH
TN

I need to validate if any of the two character values in list one exist in list two. 我需要验证列表一中两个字符值中的任何一个是否存在于列表二中。 so to take for example the final result of the example above would look like 因此,以上述示例的最终结果为例

SL- - - - - - - 
XP- - - - - - - 
XH- - - - - - - 
TQ-TN-TJ- - - - - 
XH- - - - - - - 

The asterisk is the wildcard character to use with Vlookup. 星号是与Vlookup一起使用的通配符。

With your data in A1:A13 , and the text to search for listed from H1 , this is the formula I came up with to find the text 将您的数据放在A1:A13中 ,然后从H1中列出要搜索的文本,这就是我想出的公式来查找文本

=VLOOKUP("*"&H1&"*",$A$1:$A$13,1,FALSE)

Note that this will only give the first one it comes across, so searching for TQ will give TP-TQ-TR- - - - - but not the line below it: TQ-TN-TJ- - - - - 请注意,这只会给出它遇到的第一个,因此搜索TQ将给出TP-TQ-TR- - - - -但下面没有一行: TQ-TN-TJ- - - - -

Here is the page for vlookup: 这是vlookup的页面:

https://support.office.com/en-us/article/VLOOKUP-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1 https://support.office.com/zh-CN/article/VLOOKUP-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1

It will explain the syntax of the formula and you will need to use TRUE for the 4th parameter so it will use an approximate match and not an exact match. 它将说明公式的语法,您将需要对第4个参数使用TRUE,因此它将使用近似匹配而不是精确匹配。 It will also turn up a lot of #N/A values. 它还会出现很多#N / A值。 To get rid of these I would just use a filter on that column. 为了摆脱这些,我将只在该列上使用过滤器。

Let me know if that works. 让我知道是否可行。 If not explain a little about result you need or what you need it for and I will try to help again. 如果没有对结果进行一些解释,您需要它或您需要什么,我会尝试再次提供帮助。

PS. PS。 Sort both columns before hand 手动对两列进行排序

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

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