excel search for multiple items

前端 未结 2 1395
耶瑟儿~
耶瑟儿~ 2021-01-25 22:02

I am trying to search for multiple items in a cell. If any of the terms I am looking for is present, I want cell D to display \"Laptop\", otherwise, display \"Desktop\". I can g

相关标签:
2条回答
  • 2021-01-25 22:25

    You could use the combination of OR, IFERROR and SEARCH as you suggest, but I think the simpler construct would be ...

    =IF(AND(ISERROR(SEARCH("value1",A2)),ISERROR(SEARCH("value2",A2))),"Desktop","Laptop")

    0 讨论(0)
  • 2021-01-25 22:44

    This should work:

    =IF(SUM(COUNTIF(A2,"*" &{"blah1";"blah2";"blah3"}& "*"))>0,"laptop","desktop")
    
    0 讨论(0)
提交回复
热议问题