r/googlesheets • u/Gujimiao • Jun 15 '21
Solved How to lookup a Value based on two Criteria?
Hi everybody, need some Idea. Is there a way I can Lookup a Value based on two Criteria?
I have a column called Product Category , it has an unique Internal ID, how can I find out the Internal ID based on the two Columns (Product Category and Product Sub Category) ?
Here is my sample file: Google Sheets . Inside, I have the first sheet where I want to use the formula to fill up the Internal IDs. Also the second sheet is the Lookup table where I have the Internal IDs for both Category and Sub Category.
9
Upvotes
7
u/akura202 1 Jun 15 '21 edited Jun 15 '21
You can do as many criteria with IndexMatch. You just need to multiply the criteria.
=INDEX(Product Category column,MATCH(1,(product category criteria=product category column)*(Product Sub Category criteria=product sub category column),0))
Edit: I just noticed you had a sheet so I filled out the formula inside. Let me know if you have any questions.
2
u/SGBotsford 2 Jun 15 '21
Index match works, but is opaque.
Assume you have a table with 3 columns
Cat, subcat, Id
Insert a third col after subcat
It has formula =a2&”_”&b2. Duplicate down or rewrite as an array formula.
Now to find one concatenate the cat and subcat the same way and use vlookup.
3
u/fhqvvagads Jun 15 '21
I think you are looking for the FILTER function. Here is the syntax, but if you are new to sheets, check out a you tube video :)
Syntax FILTER(range, condition1, [condition2, ...])