query with a reference cell containing a number

numeric numbers in query do not require single quote wrapping

 "select A,B,C,D
  where A = '"&A1&"'
    and B = "&B1)

with filter you can use constructed {} arrays

=FILTER({A3:B\ D3:D}; A3:A=A1; B3:B=B1)

also note that your F2 formula will work if you set formatting of B column to Plain text

 "select A,B,D 
  where "&TEXTJOIN(" and "; 1; "1=1";
    IF(A1="";; "A = '"&A1&"'");
    IF(B1="House";; "B = "&B1);
    IF(D1="";; "D = '"&D1&"'")); 1)

enter image description here

spreadsheet demo

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top