简体   繁体   English

使用Excel查找单元格中的某些字符

[英]Find certain characters in cell with Excel

I have a cell where a link can be pasted. 我有一个可以粘贴链接的单元格。 For example: https://stackoverflow.com/questions/ask 例如: https : //stackoverflow.com/questions/ask

I want the cell next to it say "wrong" IF the text contains " / " or " : " or " = ". 如果文本包含“ / ”或“ ”或“ = ”,我希望它旁边的单元格说“错误”。 It should say "Correct" is none of these 3 characters are found in the text. 应该说“正确”是在文本中找不到这3个字符。

For example:
test/
Would give "Wrong" because it contains at least 1 "/"

/test:
Would give "Wrong" because it contains at least 1 ":" and at least 1 "/"

test///////
Would give "Wrong" because it contains at least 1 "/"

test/:=
Would give "Wrong" because it contains at least 1 "/", at least 1 ":" and at least 1 "/"

test123{}+_)
Would give "Correct" because it does not contain any "/", ":" or "="

I tried to work with nested IF, but I couldn't get it to work. 我尝试使用嵌套IF,但无法使其正常工作。 I kept getting errors when adding the third character to the formula. 在公式中添加第三个字符时,我总是出错。

Try this 尝试这个

=IF(OR(ISNUMBER(SEARCH("/",A1)),ISNUMBER(SEARCH(":",A1)),ISNUMBER(SEARCH("=",A1))),"Wrong","Correct")

or prefereably this one 或者最好是这个

=IF(OR(ISNUMBER(SEARCH({"/",":","="},A1))),"Wrong","Correct")

See image for reference. 参见图片以供参考。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否有 Excel 函数来计算单元格中某些字符的出现次数? - Is there an Excel function to count occurrences of a certain characters in a cell? 如何删除Excel 2010单元格中的某些字符 - How to delete Certain Characters in a excel 2010 cell 如何从Excel的单元格中删除某些字符 - How to remove certain characters from cell on Excel 在Excel单元格下标Python中的某些字符 - Make certain characters in an Excel cell subscript Python 在Excel单元格中查找单词和其他字符 - Find word plus additional characters in Excel cell Excel公式:查找一个单元格中的所有字符是否都在另一个单元格中,即使在另一个单元格中它们是更多字符 - Excel FORMULA: Find if all the characters in a cell are in another cell even if in this another cell they are more characters Excel VBA代码查找特定单元格并删除其周围的部分 - Excel VBA code to find a certain cell and delete a section surrounding it 是否可以在Excel单元格中的两个指定字符之间查找和删除任何内容? - Is it possible to find and delete anything between two specified characters in an excel cell? 使用 Excel 公式查找特定字符并返回单元格中的下一个值 - Find specific characters and return the next value in the cell using Excel Formula 更改单元格中某些字符的颜色 - Change color of certain characters in a cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM