I have struggled with this a long time and haven't found an answer. I need to do a double lookup involving partially matching values. I need to return a certain value if my cell contains certain text.
For example, in the case shown below, I have a list of about 40,000 names in column A. In column D, I have a list of about 1,000 surnames. Each of the column A names contains one of these surnames. Column E contains a lookup value associated with each surname.
For each name in column A, I need to identify which column D surname it contains, and put that surname's associated value in column B.
For example, the name in A2 is A Smith. That contains Smith, which has an associated value of 3, so 3 would go in B2.
A3 also contains Smith, so B3 also gets the associated 3.
A4 contains White, which has an associated value of 4, so B4 gets 4.
A5 also contains White, so B5 also gets 4.
Ignore the coincidence of the column E values sometimes matching the column A row numbers. Also ignore the fact that capitalization in my example and explanation doesn't always match; in the actual data, all of the capitalization matches.
I tried to use =VLOOKUP(A2,"*"&B:C&"*",2,FALSE) but it did not work.
Addendum by fixer1234: As an abstract problem, this may still be confusing. Let me offer a common analogy.
Suppose in your community, every family has a different (i.e., unique) last name, and every member of a family shares the same last name. Each family lives together in the same house.
In column D, you have a list of the unique last names. In col E is the street address for the family with that last name. Columns D and E are a lookup table.
In column A is a list of everyone in the community. Each member of every family is in that list, but the names don't follow a standard format. Some are first name + last name, some are first initial + last name, some are last name + first name, etc. In column B, you want to put the street address for each person.
So the task is, for each column A name, find the last_name from column D that is contained in the column A name. From that last name, find the associated street address in column E, and return that to column B as the result. Since multiple members of each family are in the column A list, all of those family members will show the same resulting street address.





