This formula currently queries data based on a criteria.
How can I include another criteria, which will result in a subset of the filtered by either both (C11 and F11)
or one of them.
=if(C11<>"";
QUERY(Dados!A1:V;"select A, B, E, L, ' ', M, N, O, G, F, P, Q, R, T, I, J where H matches '"&C11&"'");
QUERY(Dados!A1:V;"select A, B, E, L, ' ', M, N, O, G, F, P, Q, R, T, I, J where A is not null label ' ' ' '"))
I guess it would be map
based, but that is too new to me.
Here is the data and the expected result in the green background table:
...and here is the file, in case you feel like giving it a shot.
You have sales data including "Product", "Company" and "Lota" (Load) and you want to query the data based on any combination of "Product" and/or "Company" and/or "Lote".
Consider this answer (applying an idea expressed by @MikeSteelson in How to use query to filter data based on certain conditions in google sheet).
Create two new sheets: "Search Results" and "Master List"
Create selection options by building Validation Rules on "Search Results"
=query({"Not filtered";'Página21'!A4:A13};"select *")
=query({"Not filtered";'Página21'!B4:B13};"select *")
=query({"Not filtered";'Página21'!D4:D13};"select *")
Build IF
statements on "Search Results"
=if(B2="Not filtered";;"Col1 matches '"&B2&"' ")
=if(B3="Not filtered";;"Col2 matches '"&B3&"' ")
=if(B4="Not filtered";;"Col4 matches '"&B4&"' ")
Build the query formula on "Search Results"
=QUERY({'Cópia de Página21'!A3:E13};"Select Col1, Col2, Col3, Col4, Col5 where Col1 is not null and "&textjoin("and ";true;C2:C4)&" ";1)
Search Results - one criteria
Search Results - two criteria
Master List - Validation Rules