Forum Discussion
giuliost
Jan 05, 2022Copper Contributor
Help! If contains formula multiple options.
Hi, I need to do a formula to return different words like this: IF contains the word "Apple" then return "Fruit", or IF contains "plate" return "Restaurants", or IF contains the word "Gym" return the...
- Jan 05, 2022
The attached version will work in older versions of Excel too, but it will return only one category.
HansVogelaar
Jan 05, 2022MVP
Your question isn't entirely clear to me. Here is the simplest scenario: I created a table with the items and their categories and named it Items. You can then use VLOOKUP:
The formula in F2 is
=VLOOKUP(F2,Items,2,FALSE)
If you have Microsoft 365 or Office 2021 you can also use XLOOKUP:
=XLOOKUP(E2,Items[Item],Items[Category])