Multiple IF commands

Copper Contributor
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")
4 Replies

@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.

Thank you! I'll give that a go!

@Wee_Maggie 

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 )

Thank you! I'm not that good with excel, I try to follow the steps for using formulae but always seem to go wrong somewhere!