Link to home
Start Free TrialLog in
Avatar of bobinorlando
bobinorlando

asked on

Excel - hierarchical lookup columns

What are the best approaches to accomplish a hierarchical lookup in excel.
What I mean is, first find the matching main category and then based on that find all subcategory matches that belong to the main category.

So for example, suppose I have a some rows of text in Worksheet1 Col A each of which has embedded within the text a brand name and a product name. e.g. "Dell laptop computers are great" or " HP laserjet printers print fast". Dell and HP would be the main categories and computer and printer would be subcategories.

And suppose I have some lookup lists in another worksheet, Worksheet2.
Worksheet2 Col A holds brand names (unique list no repeating values e.g. Dell, HP, Apple). Worksheet2 Cols B and C hold product category in Col B and product name in Col C - brand names would be a repeating field, product name would be unique and the combination of the two would be unique and tie a product to a brand) e.g. Dell Laptop, Dell Desktop, Dell Tablet, HP Laserjet, HP Inkjet, HP Thermal

Back on Worksheet1, I want to search Worksheet 1 Col A for the occurrence of a matching product category from Worksheet2 Col A and display that in Worksheet1 Col B. So if the text says "Dell computers" then Col B would say Dell.

Then in Worksheet1 Col C I want to display a dropdown list of all matching products belonging to the product category in Worksheet1 Col B (the result of the search) so that the correct product can be manually selected from the drop down. So if the text says "Dell laptop computers are great" then Col B would say Dell and the dropdown in Col C would show all the products for Dell (e.g. Desktop, Laptop, Tablet, etc.) and the user will select the correct product.

Which formulas should be used where e.g. search, index, Vlookup, etc.

I have attached a file set up with the columns described above.

Thanks in advance.
excel-hierarchical-lookup.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Glenn Ray
Glenn Ray
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bobinorlando
bobinorlando

ASKER

Thanks Glenn. Actually no, the instant file is merely a template. Other data will be substituted for the simple examples I provided and because the number of brands and products will be quite long - thousands of products of which 40-50 may roll up to a single brand -- and the text is much more complex that we are searching so we're going to manually match the names rather than trying to match them programmatically. Code works great when matching a brand name, but the text has many inconsistencies in the way product names are stated and will produce too many inaccurate matches so for that task a person is more accurate, thus the drop downs to at least narrow down what they have to review but enable them to easily pick off the right match and keep moving.
Okay; interesting to hear more about how this will be applied.  Go ahead and experiment by expanding the existing tables and adding some sample text on the first sheet that more-closely resembles your actual data.  Let me know how it works.

Regards,
-Glenn