Wednesday, February 20, 2013

yogi_FILTER Items Based On Criteria A Range of Items In Another Sheet

                                          Google Spreadsheet   Post  #1037
Yogi Anand, D.Eng, P.E.      ANAND Enterprises LLC -- Rochester Hills MI    Feb 20, 2013
user Edewen said:(!category-topic/docs/spreadsheets/mpTbGaOydy4)
Filtering data based on a range of items
Hi guys,

I've got a database with invoices and many other info related to the invoices, and I would like to filter it based on a range of invoices. I usually use the following formula :

=query(importrange(" [Database key] ";" [Database range] ");"select * where ( [Criteria column] = ' [Criteria 1] ' or [Criteria column] = ' [Criteria 2] ' or ... or [Criteria column] = ' [Criteria N] ' ) ";1)

Problem is I have a large amount of criterias and it's getting rather annoying to add another criteria whenever the need shows up. Here is a simple example of what the spreadsheet looks like :

Is there a way to tell the query function to filter the invoice data by the invoices in the "Filter Criteria" sheet ?

Thanks in advance,

following is a solution to the problem