Formula for if cell contains word, assign value for multiple
Closed
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!
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!
Related:
- If cell contains multiple text then return value
- If a cell contains a word then - Best answers
- Excel if cell contains word then assign value - Best answers
- If a cell has text then return value ✓ - Excel Forum
- If cell contains date then return value ✓ - Office Software Forum
- If cell contains (multiple text criteria) then return (corresponding text criteria) ✓ - Excel Forum
- Excel "IF" function w/ date in test cell ✓ - Excel Forum
- Excel: If Date =, then enter a value ✓ - Excel Forum
1 response
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.
[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.