Google 表格:VLOOKUP 执行“包含”而不是“等于”

问题描述 投票:0回答:1

我的主表中有以下公式:

=ARRAYFORMULA(IF(B2:B="", "", IFERROR(VLOOKUP(B2:B
, Reference!A:B, 2, FALSE), "Unknown")))

如果主工作表值与参考表上 A 列的值之一完全匹配(“等于”),则此方法有效。

但是,如果参考表的值包含在主表的值中,我希望它就足够了。

示例:

* Main Sheet:

Foo
Bar

* Reference Sheet:

Foo <- should match (Foo) (this case works already)
Fo <- should also match (Foo)
ar <- should also match (Bar)
Go <- shouldn't match

你能帮忙吗? 😄

google-sheets vlookup contains
1个回答
0
投票

你能测试一下这个吗:

=map(D:D,lambda(Σ,if(Σ="",,let(Λ,sort(A:B,len(A:A),),ifna(+filter(index(Λ,,2),len(index(Λ,,1)),not(iserror(search(index(Λ,,1),Σ)))),"Unknown")))))
  • 相应地适应您的工作表范围

© www.soinside.com 2019 - 2024. All rights reserved.