• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

IF a cell contains text and IF another cell equals a number

healthcarerich

New Member
Hello,


I have a spreadsheet with 2 columns. Column 1 contains words and column 2 contains numbers. What I would like to do is write a query to say something like: If a cell in column 1 (well say a2 for example) contains text "diab" and a cell in column 2 (well say b2 for example) equals 1, then "bad" and if not then "good". Any thoughts? I tried to write different combinations of two IF statements including the IF(ISNUMBER(SEARCH statement to no avail. Thanks!
 
=IF(AND(ISNUMBER(SEARCH("diab",A2)),B2=1),"bad","good")


If you want the text to be case-sensitive, use FIND instead of SEARCH.
 
Back
Top