Reputation: 3
Current Setup: I have two excel sheets - one with product information and one with a list of subcategories (each column of the subcategory list has a keyword that is associated with that subcategory).
Desired Result: I would like to return a subcategory for each product based on the keywords in the subcategory sheet. I am currently trying to find a way to find a substring within the product name that contains one of the keywords in the subcategory sheet and then return the relevent subcategory name.
Upvotes: 0
Views: 1729
Reputation: 152585
Like I said in my comments you will need to expand the lookup array to have one line per word:
Then you can use this formula:
=INDEX($F$1:$F$6,MATCH(TRUE,INDEX((ISNUMBER(SEARCH($G$1:$G$6,A1))),),0))
Edit
As per the photos that just got added:
=INDEX($F$1:$F$3,AGGREGATE(15,6,ROW($G$1:$I$3)/(ISNUMBER(SEARCH($G$1:$I$3,A1))),1))
Upvotes: 2
Reputation: 3153
Try this in cell F1
. Formula needs to be entered by pressing ctrl+shift+enter
=IF(COUNT(SEARCH(C1:E1,A1)),B1,"")
Upvotes: 2