Formula for if cell contains word, assign value for multiple [Closed]

- - Latest reply: ac3mark
Posts
13031
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
- Jan 14, 2016 at 04:50 PM
Hello,


I am looking for a formula to help me assign a value for multiple words and values.

If column A has the contains Apple, assign X. IF it contains grape OR banana, assign Y. If it contains neither, (or all other values) assign z.

Pretty complicated but would be cool to know.

Thanks!


See more 

1 reply

Posts
13031
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1572
-1
Thank you
OK, the syntax for IF is as follows:
[code]
=IF(LOGIC_TEST,TRUE,FALSE)
/code

So, an example of such would be:
In cell a3 set "=IF(a1="Widget","123","")"

So if you were to put Widget, in cell A1, Cell A3 would have an "123".

You can then NEST if statements, for the other values. Like so:
=IF(a1="Widget","123",if(a1="Sprocket","999",if(a1="Hinge","567","NONE")))


I hope you understand this example.