Multiple IF commands

%3CLINGO-SUB%20id%3D%22lingo-sub-508073%22%20slang%3D%22en-US%22%3EMultiple%20IF%20commands%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-508073%22%20slang%3D%22en-US%22%3EIf%20I%20have%20a%20list%20of%20foods%20in%20column%20A%20like%20apple%2C%20yoghurt%2C%20pear%2C%20potato%20etc%20and%20want%20to%20return%20those%20foods%20in%20column%20B%20as%20their%20group%20like%20fruit%2C%20veg%2C%20dairy%2C%20carb%20etc%20what%20would%20I%20use%3F%20Would%20it%20be%20IF%2FOR%3F%20I%20can't%20work%20out%20how%20to%20insert%20multiple%20commands.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20the%20below%20in%20B2%20which%20works%2C%20but%20I%20need%20multiple%20commands....%3CBR%20%2F%3E%3CBR%20%2F%3E%3DIF(OR(A1%3D%7B%22APPLE%22%2C%22BANANA%22%2C%22PEAR%22%7D)%2C%22FRUIT%22)%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-508073%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-508107%22%20slang%3D%22en-US%22%3ERe%3A%20Multiple%20IF%20commands%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-508107%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F331247%22%20target%3D%22_blank%22%3E%40Wee_Maggie%3C%2FA%3E%26nbsp%3B%2C%20it's%20better%20to%20have%20separate%20table%20where%20you%20define%20what%20is%20in%20which%20group%2C%20and%20after%20that%20INDEX%2FMATCH%20or%20VLOOKUP%20into%20column%20B%20values%20from%20A%20based%20on%20this%20table.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-508130%22%20slang%3D%22en-US%22%3ERe%3A%20Multiple%20IF%20commands%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-508130%22%20slang%3D%22en-US%22%3EThank%20you!%20I'll%20give%20that%20a%20go!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-508993%22%20slang%3D%22en-US%22%3ERe%3A%20Multiple%20IF%20commands%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-508993%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F331247%22%20target%3D%22_blank%22%3E%40Wee_Maggie%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20are%20willing%20to%20create%20a%20lookup%20table%20AND%20sort%20it%20by%20food%20then%20it%20is%20possible%20to%20use%20an%20old%20function%3C%2FP%3E%3CP%3E%3D%20LOOKUP(%20%5B%40Food%5D%2C%20FoodGroup%20)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-532696%22%20slang%3D%22en-US%22%3ERe%3A%20Multiple%20IF%20commands%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-532696%22%20slang%3D%22en-US%22%3EThank%20you!%20I'm%20not%20that%20good%20with%20excel%2C%20I%20try%20to%20follow%20the%20steps%20for%20using%20formulae%20but%20always%20seem%20to%20go%20wrong%20somewhere!%3C%2FLINGO-BODY%3E
Highlighted
New 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
Highlighted

@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!
Highlighted

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

Highlighted
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!