首页 \ 问答 \ Excel 2016:在单元格中搜索多个术语(Excel 2016: Searching for multiple terms in a cell)

Excel 2016:在单元格中搜索多个术语(Excel 2016: Searching for multiple terms in a cell)

我正在尝试在Excel 2016中使用OR条件搜索单元格中的多个字符串。

例如,我有一个字符串abcd1234 ,我想找到ab OR 12

我正在使用德语版本,其中函数SEARCH被称为SUCHEN ,它应该以相同的方式运行。

我发现这个答案表明了这个解决方案:

SEARCH({"Gingrich","Obama","Romney"},C1)

我还发现这个网站建议使用相同的语法:

SEARCH({"red","blue","green"},B5)

本网站相同:

SEARCH({"mt","msa","county","unemployment","|nsa|"},[@Tags])

因此,他们基本上会说出一个由大括号括起来的逗号分隔的搜索词列表,你很好。

但是将它们放入Excel 2016只会导致通常无意义的Excel错误消息,该消息表明公式存在错误,并且它总是突出显示花括号中的整个部分。

以第一个例子为例,我可以让Excel不抛出错误信息的唯一方法是更改​​语法,如下所示:

=SEARCH({"Gingrich";"Obama";"Romney"};C1)

但是用分号分隔搜索项并不能正确应用OR条件,因此这不是解决方案。

我从这个答案中知道我可以进行单独搜索并将它们与条件串在一起,但是我想避免这种情况,我也想知道为什么多个源确认的语法不起作用为我工作。

编辑:

好的,我开始明白这一点,感谢Solar Mike:

代码=IF(COUNT(SEARCH({"Romney","Obama","Gingrich"},A1)),1,"")确实完美无缺。

此外=COUNT(SEARCH({"Romney","Obama","Gingrich"},A1))工作。

但是=SEARCH({"Romney","Obama","Gingrich"},A1)没有。

此外=ISNUMBER(SEARCH({"Gingrich","Obama","Romney"},A1))不起作用。

我很想知道原因。


I'm trying to do a search for multiple strings in a cell with an OR-condition in Excel 2016.

E.g. I have a string abcd1234 and I want to find ab OR 12.

I'm using the german version where the function SEARCH is called SUCHEN and it should behave the same way.

I found this answer which suggests this solution:

SEARCH({"Gingrich","Obama","Romney"},C1).

I also found this website which suggests the same syntax:

SEARCH({"red","blue","green"},B5)

Same with this website:

SEARCH({"mt","msa","county","unemployment","|nsa|"},[@Tags])

So they basically say make a list of search terms separated by commas enclosed by curly braces and you're good.

But putting these into Excel 2016 just results in the usual meaningless Excel error message which says there was an error with the formula and it's always highlighting the whole part in curly braces.

Taking the first example the only way I could get Excel to not throw its error message was to change the syntax like this:

=SEARCH({"Gingrich";"Obama";"Romney"};C1)

But separating the search terms with semicolons doesn't apply the OR-condition correctly, so this is not the solution.

I'm aware from this answer that I could make separate searches and string them together with a condition, but I would like to avoid that, and I also want to know why the syntax that is supposed to work as confirmed by multiple sources is not working for me.

EDIT:

Okay, I'm starting to understand this, thanks to Solar Mike:

The code =IF(COUNT(SEARCH({"Romney","Obama","Gingrich"},A1)),1,"") works indeed perfectly fine.

Also =COUNT(SEARCH({"Romney","Obama","Gingrich"},A1)) works.

But =SEARCH({"Romney","Obama","Gingrich"},A1) does not.

Also =ISNUMBER(SEARCH({"Gingrich","Obama","Romney"},A1)) does not work.

I'd love to know the reason why.


原文:https://stackoverflow.com/questions/51472960
更新时间:2022-09-21 15:09

最满意答案

只需在更改图层之前设置边框样式

[_txt_PhoneNo setBorderStyle:UITextBorderStyleNone];

这会奏效。 :)


Just set the border style before changing layers

[_txt_PhoneNo setBorderStyle:UITextBorderStyleNone];

This will work. :)

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)