Forum Discussion

Wee_Maggie's avatar
Wee_Maggie
Copper Contributor
May 01, 2019

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")

4 Replies

    • Wee_Maggie's avatar
      Wee_Maggie
      Copper Contributor
      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!
  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond 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.

Resources