IF a cell contains a string

前端 未结 3 1779
甜味超标
甜味超标 2021-02-04 23:40

How can I assign a value to cells if it\'s neighbour contains a specific string?

For example, fields in column A:

    dog11
    cat22
    cow11
    chick         


        
3条回答
  •  旧时难觅i
    2021-02-05 00:37

    You can use OR() to group expressions (as well as AND()):

    =IF(OR(condition1, condition2), true, false)
    
    =IF(AND(condition1, condition2), true, false)
    

    So if you wanted to test for "cat" and "22":

    =IF(AND(SEARCH("cat",a1),SEARCH("22",a1)),"cat and 22","none")
    

提交回复
热议问题