title: Quotation marks and apostrophes in the same string in QUERY Google Sheets function
body: <p>I'm wondering how one might handle a query like this. Let's suppose I had the following text contained in Cell A2 of a spreadsheet:</p>
  
  <pre><code>Case Bakers' Flats 12" White Flour Tortillas 10/12ct
  </code></pre>
  
  <p>and needed to put the following formula into B2:</p>
  
  <pre><code>=QUERY(importrange("KEY", "DATA!A1:Z1000"), "select Col24 where (Col1 = '"&amp;A2&amp;"')")
  </code></pre>
  
  <p>It would produce an error. </p>
  
  <p>My question is: Is there any way to avoid tripping up the query when the string I am using contains any assortment of quotation marks and apostrophes?</p>