SOLVED

If/Then statement needed!

Occasional Contributor

Hello,

 

Thanks for taking the time to read this message, I am merely a basic user of Excel, but I require a slightly more complicated formula that I will attempt to explain...

 

I intend to paste some text into excel cells in column A, then I would like column B to detect particular words within column A and show a prewritten message that I have created. I will have many prewritten messages on the excel sheet. Also, I will input various words/phrases for the formula to detect.

 

For example, if I copy/paste some text that has a 'yes' within in it, I want a 'message 1' (that I have created elsewhere on the excel sheet) to appear in column B. 

 

If I copy/pasted some text that has a 'no' within it, then there would be a 'message 2' appearing in column B.

 

Hope this makes sense, if you could please help me build this excel sheet - it would be much appreciated!

2 Replies
best response confirmed by Hans Vogelaar (MVP)
Solution

@jamesvinicombe 

=IF(COUNTIF(A1,"*"&$E$1&"*")>0,$F$1,IF(COUNTIF(A1,"*"&$E$2&"*")>0,$F$2,""))

Is the attached example similar to what you are looking for?

Thats exactly it, thank you! You're a bloody legend! Really big help!