SOLVED

If/Then statement needed!

%3CLINGO-SUB%20id%3D%22lingo-sub-3428740%22%20slang%3D%22en-US%22%3EIf%2FThen%20statement%20needed!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3428740%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20taking%20the%20time%20to%20read%20this%20message%2C%20I%20am%20merely%20a%20basic%20user%20of%20Excel%2C%20but%20I%20require%20a%20slightly%20more%20complicated%20formula%20that%20I%20will%20attempt%20to%20explain...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20intend%20to%20paste%20some%20text%20into%20excel%20cells%20in%20column%20A%2C%20then%20I%20would%20like%20column%20B%20to%20detect%20particular%20words%20within%20column%20A%20and%20show%20a%20prewritten%20message%20that%20I%20have%20created.%20I%20will%20have%20many%20prewritten%20messages%20on%20the%20excel%20sheet.%20Also%2C%20I%20will%20input%20various%20words%2Fphrases%20for%20the%20formula%20to%20detect.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20example%2C%20if%20I%20copy%2Fpaste%20some%20text%20that%20has%20a%20'yes'%20within%20in%20it%2C%20I%20want%20a%20'message%201'%20(that%20I%20have%20created%20elsewhere%20on%20the%20excel%20sheet)%20to%20appear%20in%20column%20B.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20copy%2Fpasted%20some%20text%20that%20has%20a%20'no'%20within%20it%2C%20then%20there%20would%20be%20a%20'message%202'%20appearing%20in%20column%20B.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20makes%20sense%2C%20if%20you%20could%20please%20help%20me%20build%20this%20excel%20sheet%20-%20it%20would%20be%20much%20appreciated!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3428740%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3428961%22%20slang%3D%22en-US%22%3ERe%3A%20If%2FThen%20statement%20needed!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3428961%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1401670%22%20target%3D%22_blank%22%3E%40jamesvinicombe%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DIF(COUNTIF(A1%2C%22*%22%26amp%3B%24E%241%26amp%3B%22*%22)%26gt%3B0%2C%24F%241%2CIF(COUNTIF(A1%2C%22*%22%26amp%3B%24E%242%26amp%3B%22*%22)%26gt%3B0%2C%24F%242%2C%22%22))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EIs%20the%20attached%20example%20similar%20to%20what%20you%20are%20looking%20for%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3429079%22%20slang%3D%22en-US%22%3ERe%3A%20If%2FThen%20statement%20needed!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3429079%22%20slang%3D%22en-US%22%3EThats%20exactly%20it%2C%20thank%20you!%20You're%20a%20bloody%20legend!%20Really%20big%20help!%3C%2FLINGO-BODY%3E
New 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!