Excel - 如何从大列表中找到通配符字符串 [英] Excel - how to find wildcard string from large list

查看:262
本文介绍了Excel - 如何从大列表中找到通配符字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据表由a)索引号和b)与这些索引号相关联的字符串组成。在我的模板中,用户将输入一个索引号,并显示与该索引号相关联的字符串。



例如

  1 Bag 
1 Catsgsg
1狗
1 oygg
2 Stackoverflow
2 tacks
2双筒望远镜
2全部



1000 Bonobos
1000 Canopy
1000 Ascot

如果用户输入数字1000,我怎么能把倭黑猩猩知道有一个字,而不是实际的字?我如何解决我的数组公式工作通配符?

  = INDEX(Partners!$ D $ 2:$ D $ 2227,MATCH(1,(Partners!$ A $ 2:$ A $ 2227 = number)*(Partners!$ C $ 2:$ C $ 2227 =b *),0))


$ b $编辑:我能够调整callum的解决方案,并为多个通配符字符串配置公式帐户。

  = INDEX(Partners!$ D $ 2:$ D $ 2227,MATCH(1,IFERROR(SEARCH(num& 合作伙伴$ A $ 2:$ A $ 2227建筑事务所$ D $ 2:!$ D $ 2227),0)+ IFERROR(SEARCH(NUM&安培; B *,合作伙伴$ A $ 2:$ A $ 2227建筑事务所!$ D $ 2:$ D $ 2227中),0)+ IFERROR(SEARCH(NUM和放大器; C *,合作伙伴$ A $ 2:$ A $ 2227中建筑事务所$ D $ 2:!$ D $ 2227中),0),0 ))


解决方案

只有具体的功能接受通配符,所以你需要要使用其中的一个,如果你想使用 * 通配符。 SEARCH 是一个例子:

  = INDEX(Partners!$ D $ 2 :$ D $ 2227,MATCH(1,IFERROR(SEARCH(number&b *,Partners!$ A $ 2:$ A $ 2227& Partners!$ B $ 2:$ B $ 2227),0),0))

或者,您可以完全避免使用通配符:

  = INDEX(伙伴$ D $ 2:$ D $ 2227,MATCH(数​​&安培; b 的,合作伙伴$ A $ 2:!!$ A $ 2227&安培; LEFT(伙伴$ b $ 2 :$ B $ 2227,1),0))



都输入为数组公式( Ctrl + Shift + 输入


My data table consists of a) index numbers and b) strings associated with those index numbers. In my template, a user would input an index number and the string associated with that index number would show.

For example

1    Bag
1    Catsgsg
1    Dogs
1    oygg
2    Stackoverflow
2    tacks
2    Binoculars
2    all
.
.
.
1000   Bonobos
1000   Canopy
1000   Ascot

If a user inputs the number 1000, how can I pull the word bonobos knowing that there's a b word but not the actual word? How can I fix my array formula to work for wildcards?

=INDEX(Partners!$D$2:$D$2227,MATCH(1,(Partners!$A$2:$A$2227=number)*(Partners!$C$2:$C$2227="b *"),0))

EDIT: I was able to tweak callum's solution and have the formula account for multiple wildcard strings.

=INDEX(Partners!$D$2:$D$2227,MATCH(1,IFERROR(SEARCH(num&"A*",Partners!$A$2:$A$2227&Partners!$D$2:$D$2227),0)+IFERROR(SEARCH(num&"B*",Partners!$A$2:$A$2227&Partners!$D$2:$D$2227),0)+IFERROR(SEARCH(num&"C*",Partners!$A$2:$A$2227&Partners!$D$2:$D$2227),0),0))

解决方案

Only specific functions accept wildcards so you will need to use one of them if you want to use the * wildcard. SEARCH is one example:

=INDEX(Partners!$D$2:$D$2227,MATCH(1,IFERROR(SEARCH(number&"b*",Partners!$A$2:$A$2227&Partners!$B$2:$B$2227),0),0))

Or, you can just avoid the wildcard altogether:

=INDEX(Partners!$D$2:$D$2227,MATCH(number&"b",Partners!$A$2:$A$2227&LEFT(Partners!$B$2:$B$2227,1),0))


both entered as array formulae (Ctrl+Shift+Enter)

这篇关于Excel - 如何从大列表中找到通配符字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆