Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
需要excel公式将单元格内容与带有特殊字符的部分字符串数组进行比较,并在下一列中返回结果_Excel_Excel Formula_String Matching - Fatal编程技术网

需要excel公式将单元格内容与带有特殊字符的部分字符串数组进行比较,并在下一列中返回结果

需要excel公式将单元格内容与带有特殊字符的部分字符串数组进行比较,并在下一列中返回结果,excel,excel-formula,string-matching,Excel,Excel Formula,String Matching,我有一列html链接,例如 Sheet 1, Column A: a href="http://junk.com"> a href="http://example.com"> a href='/relative-link/' target=''> 第1页A栏: a href=”http://junk.com"> a href=”http://example.com"> a href='/relative link/'target=''> 我想比较另一张表上a:a中的

我有一列html链接,例如

Sheet 1, Column A: a href="http://junk.com"> a href="http://example.com"> a href='/relative-link/' target=''> 第1页A栏: a href=”http://junk.com"> a href=”http://example.com"> a href='/relative link/'target=''> 我想比较另一张表上a:a中的子字符串列表,并返回B:B中的值。 例如,我在另一张纸上的列表可能是:

Sheet2: Column A Column B example.com mine href='/ relative href="http external 第2张: A列B列 example.com矿山 href='/relative href=“http外部 因此,我需要一个公式,用于html链接列返回:

Sheet1: Column A Column B (formula) a href="http://junk.com"> external a href="http://example.com"> mine a href='/relative-link/' target=''> relative 表1: A列B列(公式) a href=”http://junk.com“>外部 a href=”http://example.com“>我的 a href='/relative link/'target=''>relative 有什么想法吗?我知道如何使用索引/匹配进行精确匹配,但不确定如何使用部分子字符串匹配。此外,我不知道某些子字符串中的特殊字符是否需要与单个字母数字单词不同的字符

非常感谢。

使用:

=INDEX(Sheet2!$B$1:$B$3,AGGREGATE(15,6,ROW(Sheet2!$A$1:$A$3)/(ISNUMBER(SEARCH(Sheet2!$A$1:$A$3,A1))),1))
这将返回第2页上的第一个匹配项,因此将该列表按优先级排序

使用:

=INDEX(Sheet2!$B$1:$B$3,AGGREGATE(15,6,ROW(Sheet2!$A$1:$A$3)/(ISNUMBER(SEARCH(Sheet2!$A$1:$A$3,A1))),1))
这将返回第2页上的第一个匹配项,因此将该列表按优先级排序


对于受@Gary'sStudent post()启发而没有聚合功能的旧版Excel,您可以尝试以下公式:
=VLOOKUP(查找(99^99,搜索(Sheet2!$A$1:$A$3,A1),Sheet2!$A$1:$A$3),Sheet2!$A$1:$B$3,2,0)
。但是,这个字符串
href=“http
也显示在
A href=”http://example.com">
因此,结果并不理想。我找不到解决这个问题的方法,但也许@Gary的学生会出现并进一步帮助您。对于受@Gary'sStudent post()启发而没有聚合功能的旧版Excel,您可以尝试以下公式:
=VLOOKUP(查找(99^99,搜索(Sheet2!$a$1:$a$3,A1),Sheet2!$a$1:$a$3,Sheet2!$a$1:$B$3,2,0)
。但是,此字符串
href=“http
也显示在
a href=”中http://example.com“>
因此,结果并不理想。我找不到解决这个问题的方法,但也许@Gary的学生会出现并进一步帮助您。