简体   繁体   English

Excel 公式用于在一个单元格中搜索两个文本并根据结果返回值

[英]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.

相关问题 根据另一个单元格中的值编辑一个单元格中的部分文本的公式 - Formula to edit part of a text in one cell based on an values in another cell Excel 公式检查两列的值并返回特定的单元格值 - Excel Formula to check value of two columns and return specific cell values Excel公式基于两个单元格的值来计算一个单元格的值 - Excel formula to the value of a cell based on two cells' values Excel 公式 - 如果为真,则返回文本和单元格值 - Excel formula - IF true, return a text and cell value Excel-如何创建公式以将单元格返回到另一个公式的结果右侧 - Excel - How to create a formula to return a cell to the right of the result of another formula Excel中的公式以基于合并的单元格添加值 - Formula in Excel to add values based on a merged cell excel根据其他两个值返回单元格的值 - excel return the value of a cell based on two other values 在Excel中使用什么公式将一个单元格上丢失的文本返回到另一个单元格 - What formula to use in Excel to return missing text on one cell to another cell Excel公式比较两列,如果找到匹配项,则检查下一个单元格的值,然后返回结果 - Excel Formula to compare two columns and if match found check the next cell for a value and then return the result Excel公式获取一个单元格中的所有值 - Excel formula to get all values in one cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM