Forum Discussion
Wee_Maggie
May 01, 2019Copper Contributor
Multiple IF commands
If I have a list of foods in column A like apple, yoghurt, pear, potato etc and want to return those foods in column B as their group like fruit, veg, dairy, carb etc what would I use? Would it be IF/OR? I can't work out how to insert multiple commands.
I have the below in B2 which works, but I need multiple commands....
=IF(OR(A1={"APPLE","BANANA","PEAR"}),"FRUIT")
I have the below in B2 which works, but I need multiple commands....
=IF(OR(A1={"APPLE","BANANA","PEAR"}),"FRUIT")
4 Replies
- PeterBartholomew1Silver Contributor
If you are willing to create a lookup table AND sort it by food then it is possible to use an old function
= LOOKUP( [@Food], FoodGroup )
- Wee_MaggieCopper ContributorThank you! I'm not that good with excel, I try to follow the steps for using formulae but always seem to go wrong somewhere!
- SergeiBaklanDiamond Contributor
Wee_Maggie , it's better to have separate table where you define what is in which group, and after that INDEX/MATCH or VLOOKUP into column B values from A based on this table.
- Wee_MaggieCopper ContributorThank you! I'll give that a go!