Reputation: 253
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
https://docs.google.com/spreadsheets/d/1RNku0Bpj-hbBkKcfGjfJ_CU9gQbWAz6MxGAlK5oGOl0/edit?usp=sharing
Scenario1: Get date in September(B)
Scenario2: Get the data that's show Green, Red(A)
Scenario3: Get the date that filling in billed date(D) also is September
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) ")
Upvotes: 1
Views: 1469
Reputation: 15308
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' OR A='Red') and D>=DATE'2021-09-01' AND D<=Date'2021-09-30' ")
Upvotes: 2
Reputation: 1
=FILTER(A2:D,MONTH(B2:B)=9,REGEXMATCH(A2:A,"Red|Green"),MONTH(D2:D)=9)
Upvotes: 0