Here is a working example based on your data with a few extra checks thrown in for good measure (remember it is an Array so you must commit the formula holding CTRL + SHIFT + ENTER not just Enter)
Could you break it down a little as to what the constituent parts do and how it functions as a whole?
Yikes... that could take a while in truth... if we look at it like this:
the sections in red we will ignore as essentially this is used purely to cater for when no keywords can be found in the movie title.... so we're left with:
The INDEX reflects our results range - our channels... what comes after that is used to determine the row_number in which a keyword is first found in the title, so this:
Basically says if the keyword is not blank
and (by means of *) the keyword can be found within the movie title
then return the ROW number that contains the found keyword
else if you can't find it return the ROW above the last row in our table
This will generate an array of numerical values, one for each keyword in our keyword table... against which the MIN is applied
If none of the keywords have been found the MIN will return 11 as the entire array will be full of value 11 (not found output), however, if any keywords have been found they will return a lower number than 11... the MIN will thus pull the lowest number which if < 11 means a keyword was located.
The INDEX uses the above output to establish which Channel to be returned
If no values were found and MIN is 11 then the INDEX will generate a #REF! error as there is no Row 11 in the range A1:A10 ... this is where the LOOKUP comes in as it handles those errors and returns a Null (this can be altered).
If you post up your test file in which you're failing to get the desired results I will try and take a look at some point later today.
Bookmarks