[英]Excel formula for searching two text in one cell and return values based on the result
I am looking for an excel formula for searching two text(dba,BP) in one cell and return value if dba found then return dba and if BP found then return BP.我正在寻找一个 excel 公式,用于在一个单元格中搜索两个文本(dba,BP)并返回值,如果找到 dba,则返回 dba,如果找到 BP,则返回 BP。 I have used below formula but its only returning one value.
我使用了下面的公式,但它只返回一个值。
=IF(OR(ISNUMBER(SEARCH("dba,A25)),ISNUMBER(SEARCH("bpi",A25))),"dba","") =IF(OR(ISNUMBER(SEARCH("dba,A25)),ISNUMBER(SEARCH("bpi",A25))),"dba","")
You can put another IF inside first IF, so that it works like if first case not match, it will test for second case您可以在第一个 IF 中放置另一个 IF,这样如果第一个案例不匹配,它将测试第二个案例
=IF(<first case>, <first case matched> ,IF(<second case>, <second case matched>, <no matches>))
In your case,在你的情况下,
=IF(ISNUMBER(SEARCH("dba",A1)),"dba",IF(ISNUMBER(SEARCH("bpi",A1)),"bpi",""))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.