Forum Discussion
Help! If contains formula multiple options.
- Jan 05, 2022
The attached version will work in older versions of Excel too, but it will return only one category.
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])
Hi, Thanks HansVogelaar and SergeiBaklan for the answers and sorry if I wasn't clear: I would like to "create" the category (column B) based on the word in column A (not only the exact match but also if the word that i'm looking for is within a sentence). For example if I have in cell A2 > "Lime mobility 5.1.22 3 $" then I would like the column B to return me "Mobility", or if I have in cell A3 "coffee bar 4.1.22 4$" column B return "Food". I tried: =IF(ISNUMBER(SEARCH("Lime",A)),"Mobility") and it worked but couldn't find a way to add more variables. Thanks