[英]Formula to edit part of a text in one cell based on an values in another cell
[英]Excel formula for searching two text in one cell and return values based on the result
我正在尋找一個 excel 公式,用於在一個單元格中搜索兩個文本(dba,BP)並返回值,如果找到 dba,則返回 dba,如果找到 BP,則返回 BP。 我使用了下面的公式,但它只返回一個值。
=IF(OR(ISNUMBER(SEARCH("dba,A25)),ISNUMBER(SEARCH("bpi",A25))),"dba","")
您可以在第一個 IF 中放置另一個 IF,這樣如果第一個案例不匹配,它將測試第二個案例
=IF(<first case>, <first case matched> ,IF(<second case>, <second case matched>, <no matches>))
在你的情況下,
=IF(ISNUMBER(SEARCH("dba",A1)),"dba",IF(ISNUMBER(SEARCH("bpi",A1)),"bpi",""))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.