Gabriel Crivelli
Gabriel Crivelli

Reputation: 105

How to Query Function Google Spreadsheet - Data filtering based on multiple criteria (multiple columns to check at once)

I have a Google Spreadsheet that contains five (5) sheets, and we are starting to use them as a basic CRM to manage tasks, projects, deadlines and customers in a very basic fashion. We assign tasks to each other in the first sheet "TaskRecords", and then we will populate the other sheets with the information there. This the google spreadsheet (with mock data):

https://docs.google.com/spreadsheet/ccc?key=0AkB1z6YLt9N_dDU0VGgyZjN5cGt2UmtRb05FbWRRZ1E#gid=6

What I would like to achieve is to filter by means of a Query function or so, to use the spreadsheet as a database and filter the following: Taks by Team Member, by Customer, by Deadline, by Project, etc, and displaying the on other sheets. I tried with Query formula: =QUERY(TaksRecords!A2:I17; "select A, B, C, D, E, F, H, I where G="AL""; 1). Where I would like to filter everything that Team Member "AL" has been assigned to do, but I'm missing something. I also tried to pull data out to other sheets using Arrayformula, but it only fetchs the cells I tell it to, and does no filtering based on multiple criteria at the same time. Furthermore, there will be new rows of data added every day.

Maybe there is some script already written that solves this, I've been testing for several days with different options but couldn't get them to work.

Any hints?

Thanks.

Upvotes: 2

Views: 34803

Answers (4)

Prabhakar Battula
Prabhakar Battula

Reputation: 21

Use this query

=QUERY(JOURNAL!A1:E100, "select A, B, C, D, E where col1='Fruit' and Col2='Sweet'", 1)

Upvotes: 2

user3736818
user3736818

Reputation: 1

How about doing a query of two conditions like:

WHERE Col1='Fruit' AND Col2='Sweet' 

Upvotes: -1

Aaron Dahl
Aaron Dahl

Reputation: 1

I'm no expert in this area, but I would use FILTER instead of QUERY. I use Query for a pre-defined formula to find certain records, and Filter to take a large quantity of records and narrow it down by certain defined criteria. Query is nice and clean, but it appears FILTER will suit your needs better.

Upvotes: 0

Mogsdad
Mogsdad

Reputation: 45750

It's just a matter of quotes. Try this, with single quotes around the name 'AL':

=QUERY(TaksRecords!A2:I17; "select A, B, C, D, E, F, H, I where G='AL'"; 1)

Upvotes: 1

Related Questions