Google sheets query will not bring forth 3rd level filter criteria

Viewed 16

I am using this query in google sheets to search a table on one sheet and bring forth rows containing keywords based on 2 data validated drop down menus.

=QUERY('BDDB '!$A$2:$AA,"SELECT * WHERE 1=1 "&IF(E10="All Departments",""," AND LOWER(B) = LOWER('"&E10&"')")&IF(G10="Hiring Manager",""," AND LOWER(D) = LOWER('"&G10&"')"),1)

This filter works great and I was wondering if/how I could add a third search parameter because once I add this text

&IF(I10="Priority Level",""," AND = ('"&I10&"')")

before the last ,1), the formula is error free but the third data validated drop down will not act as a filter. The 'priority level' is a numeric value rather than words so I think I may just have a basic syntax issue or a larger one if I'm jumbling up too many IF statements.

1 Answers

if its numeric do not use single quotes. try:

=QUERY('BDDB '!$A$2:$AA,
 "WHERE 1=1 "&
  IF(E10="All Departments",," AND LOWER(B) = '"&LOWER(E10)&"'")&
  IF(G10="Hiring Manager",,"  AND LOWER(D) = '"&LOWER(G10)&"'")&
  IF(I10="Priority Level",,"  AND I = "&I10, 1)
Related