Excel:在单元格中搜索多个术语 [英] Excel: Searching for multiple terms in a cell

查看:112
本文介绍了Excel:在单元格中搜索多个术语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  = IF(ISNUMBER(SEARCH) (* Gingrich *,C1)),1,)

为了在C1中存在Gingrich,如果存在,它会显示1。



我想要做的是一次搜索多个术语。任何人都知道如何在这里添加OR函数,以便我可以搜索Gingrich OR Obama OR Romney等...

解决方案

另一种方式

  = IF(SUMPRODUCT( - (NOT(ISERR(SEARCH({Gingrich,Obama罗姆尼},C1))))))> 0,1,)



<另外,如果你保留一个值列表,如A1到A3,那么你可以使用

  = IF(SUMPRODUCT( -  - (NOT(ISERR(SEARCH($ A $ 1:$ A $ 3,C1)))))> 0,1,)

Search()函数中根本不需要通配符,因为Search()返回找到的字符串的位置。


I use this handy equation to search for a term inside of a cell in excel.

=IF(ISNUMBER(SEARCH("*Gingrich*",C1)),"1","")

This equation searches for the presence of Gingrich in C1, if it exists, it displays a 1.

All I'd like to do is search for more than one term at a time. Anyone know how to add an OR function into this so I can search for Gingrich OR Obama OR Romney etc... ?

解决方案

Another way

=IF(SUMPRODUCT(--(NOT(ISERR(SEARCH({"Gingrich","Obama","Romney"},C1)))))>0,"1","")

Also, if you keep a list of values in, say A1 to A3, then you can use

=IF(SUMPRODUCT(--(NOT(ISERR(SEARCH($A$1:$A$3,C1)))))>0,"1","")

The wildcards are not necessary at all in the Search() function, since Search() returns the position of the found string.

这篇关于Excel:在单元格中搜索多个术语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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