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 findab OR 12
.I'm using the german version where the function
SEARCH
is calledSUCHEN
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
最满意答案
只需在更改图层之前设置边框样式
[_txt_PhoneNo setBorderStyle:UITextBorderStyleNone];
这会奏效。 :)
Just set the border style before changing layers
[_txt_PhoneNo setBorderStyle:UITextBorderStyleNone];
This will work. :)
相关问答
更多-
不确定这里的波动究竟是什么意思,但是如果你想改变text-shadow的模糊半径,你可以在这里使用animation ...... 我正在使用@keyframes和动画X Y和模糊text-shadow 。 如果需要,只需将值8px更改为其他值,即可为特定轴或模糊半径设置动画。 #shadow { text-shadow: 4px 4px 4px #aaa; animation: animate-shadow 1s ease-in infinite; } @keyframes anima ...
-
ios textfield弹跳(ios textfield bounces)[2022-02-27]
我想出了这个问题:使用的字体存在问题(自定义字体)。 I figured this one out: there was a problem with the font used (a custom font). -
ios文本字段重叠键盘(ios textfield overlaps keyboard)[2023-04-06]
自从我问这个问题已经很久了,我忘记了这一点,无论如何我发现当视图有阴影时,可能会出现这种渲染问题,只是禁用阴影.. it has been a long time since i asked this question and i forgot about that, anyway i found that these kind of rendering problems may occur when views have shadows, just disabled the shadow.. -
只需在更改图层之前设置边框样式 [_txt_PhoneNo setBorderStyle:UITextBorderStyleNone]; 这会奏效。 :) Just set the border style before changing layers [_txt_PhoneNo setBorderStyle:UITextBorderStyleNone]; This will work. :)
-
菜单与阴影效果(Menu With Shadow Effect)[2022-07-10]
您可以使用伪元素 - DEMO上的径向渐变来执行此操作 CSS: ul { margin: 5em auto; padding: 0; background: silver; text-align: center; } li { display: inline-block; position: relative; margin: 1em; padding: .1em 2em; background: #414141; color ... -
//Drop Shadow [view.layer setShadowColor: [UIColor grayColor].CGColor]; [view.layer setShadowOpacity:0.8]; [view.layer setShadowRadius:3.0]; [view.layer setShadowOffset:CGSizeMake(2.0, 2.0)]; //Drop Shadow [view.layer setShadowColor: [UIColor grayColor].C ...
-
也许,为该图层添加阴影似乎很有效。 你可能想尝试这样的事情: // perspectiveView.transform = CGAffineTransformMakeRotation(-50.0f); perspectiveView.layer.shadowOffset = CGSizeMake(10, 10); perspectiveView.layer.shadowRadius = 5.0; perspectiveView.layer.shadowOpacity = 0. ...
-
如何在iOS 6中删除导航栏标题的默认阴影效果(How to remove the default shadow effect of navigation bar title in iOS 6)[2022-03-23]
你可以设置阴影lIkE: [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.0], UITextAttributeTextShadowColor, [NSValue valueWithUIOffset:UIOffsetMake(0, 0)], ... -
好吧:我正在寻找同样的事情,但遗憾的是没有运气。 我决定创建自己的羽毛代码。 将此代码添加到UIImage扩展,然后调用[image featherImageWithDepth:4] ,4只是示例。 尽量保持尽可能低的深度。 //============================================================================== - (UIImage*)featherImageWithDepth:(int)featherDepth { / ...
-
要从输入字段中删除内部阴影,请添加-webkit-appearance: none; 它将从输入字段中删除内部阴影。 这个DEMO已在safari iOS7上测试过。 input[type="text"], textarea { display:block; -webkit-appearance: none; /*this property remove the inner shadow*/ border-radius:1px; background-color: white; hei ...