title: QUERY and IF function
body: <p>I have a long, long query function into a if function from three cells (below is a simple version with two cells):</p>
  
  <pre><code>=IF(B2="All";Query(Sheet!1:100000;"select B,C,F"); Query(Sheet!1:100000;"select B,C,F where C contains """&amp;B2&amp;""" and B contains """&amp;D2&amp;"""  ")
  </code></pre>
  
  <p>B2 and D2 are the cells where I have item lists that fill my query</p>
  
  <p>Now I want: insert a blank value at the start of the query. I can use:</p>
  
  <pre><code>if (isblank(B2);iferror(1/0)
  </code></pre>
  
  <p>but doesn't go with two or more cells. </p>
  
  <pre><code>=if (isblank(B2);iferror(1/0), if(isblank(D2);iferror(1/0),,IF(B2="All";Query(Sheet1!1:100000;"select B,C,F"); Query(Sheet1!1:100000;"select B,C,F, where C contains """&amp;B2&amp;""" and B contains """&amp;D2&amp;""" "))))
  </code></pre>
  
  <p>More, I want learn to use different conditions (with OR and AND).</p>
  
  <p>Can you help me?</p>