title: Import data between spreadsheets where column = value?
body: <p>Note: My question is similar Googe Spreadsheets' <a href="http://support.google.com/drive/bin/answer.py?hl=en&amp;answer=155183" rel="nofollow noreferrer">ImportRange</a> function.</p>
  
  <p>Is it possible in Google Spreadsheets or Microsoft Excel to import data based on cell values?</p>
  
  <p>For example, can I copy contents of Sheet1 to another sheet where column B == "foo"?</p>
  
  <p>Target (Sheet1):</p>
  
  <p><img src="https://i.stack.imgur.com/IW9Kg.png" alt="enter image description here"></p>
  
  <p>The destination sheet should only copy Row 2 and 4 since those are the only ones containing "foo"</p>
  
  <p>Edit:</p>
  
  <p>For Google Docs, I am looking to something like this:</p>
  
  <p><code>=ImportRange("spreadsheetkey", QUERY('sheetname'!A6:E10, "SELECT A, B = 'foo'"))</code> however I can't get it to work.</p>