IF a cell contains a string

SEARCH does not return 0 if there is no match, it returns #VALUE!. So you have to wrap calls to SEARCH with IFERROR.

For example…

=IF(IFERROR(SEARCH(“cat”, A1), 0), “cat”, “none”)

or

=IF(IFERROR(SEARCH(“cat”,A1),0),”cat”,IF(IFERROR(SEARCH(“22″,A1),0),”22″,”none”))

Here, IFERROR returns the value from SEARCH when it works; the given value of 0 otherwise.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)