简体   繁体   English

匹配Excel中的字符串中的多个部分字符串

[英]match multiple partial strings from string in excel

So here I have 2 tables. 所以这里有2张桌子。

ring    layer1  layer2  output
12      45      46      bingo
12      34      75  
13      23      47  
14      23      34      nice_work
14      12      15  
14      45      23  
14      67      89      wow
25      90      124 
67      76      341 


ring    whole_string    value as output
12      23_45_12_78_46  bingo
12      78_89_23_45_90  great
13      23_89_90        awesome
14      45_78_23_45_34  nice_work
14      88_86_85_12     cool
14      67_89_111       wow

what I need is: value as output from tbl2 if
1. tbl1 ring = tbl2 ring
2. tbl1 layer1 & layer2 values must be present in tbl2 whole_string

Can someone help me with excel formula? 有人可以帮我提供Excel公式吗?

Thank you... 谢谢...

I tried using a for loop. 我尝试使用for循环。 It takes a whole lot time. 这需要很多时间。

You could use: 您可以使用:

在此处输入图片说明

Formula in D2 : D2公式:

=IFERROR(INDEX($H$1:$H$7,AGGREGATE(14,3,($F$2:$F$7=A2)*(IF(ISNUMBER(SEARCH("_"&B2&"_","_"&$G$2:$G$7&"_")),1,""))*(IF(ISNUMBER(SEARCH("_"&C2&"_","_"&$G$2:$G$7&"_")),1,""))*ROW($F$2:$F$7),1)),"")

Entered as array formula through: Ctrl + Shift + Enter 通过以下方式输入为数组公式: Ctrl + Shift + Enter

Drag down... 拖累...

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

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