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

时间:2019-07-05 07:37:25

标签: excel excel-formula

所以这里有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

有人可以帮我提供Excel公式吗?

谢谢...

我尝试使用for循环。这需要很多时间。

1 个答案:

答案 0 :(得分:2)

您可以使用:

enter image description here

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)),"")

通过以下方式作为数组公式输入: Ctrl + Shift + Enter

向下拖动...

相关问题