Home > OS >  How to use where query in Google Spreadsheet with filter multiple conditions
How to use where query in Google Spreadsheet with filter multiple conditions

Time:09-27

I have some of the scenario for the google sheets filtering and brings the data to another sheets. Having some issue on combining with multiple AND when using "Where". It does not show result after apply for the syntax. I was wondering how if we want to filtering more than 1, maybe have 2,3,4,5 data to filter. How do we really make it in the query GoogleSheets, please help me to have more clearer understanding on the "where" query with multiple conditions. Thank you so much!

Here is the link of the google sheets

enter image description here

The formula that I'm trying to apply is failed to run....

=QUERY(A:D, "select SUM(C) WHERE B >= DATE'2021-09-01' AND B<=Date'2021-09-30'AND A='Blue' AND A='Green' AND ISDATE(D) ")

CodePudding user response:

A can't be at the same time Blue and Green. So try

=QUERY(A:D, "select SUM(C) WHERE B >= DATE'2021-09-01' AND B<=Date'2021-09-30'AND (A='Blue' OR A='Green') AND D IS NOT NULL")

enter image description here

CodePudding user response:

=FILTER(A2:D,MONTH(B2:B)=9,REGEXMATCH(A2:A,"Red|Green"),MONTH(D2:D)=9)

  • Related