title: Dynamic Sheet Name in Query in Google Spreashsheet
body: <p>In Google spreadsheet I want to query data in another sheet but the problem is that the name of sheet is present in a cell. So is there a way in QUERY function to dynamically mention sheet name. Basically I am trying to do something like this but with dynamic sheet name:</p>
  
  <p><code>=QUERY('2012'!A2:F;"select C, sum(F) where A='December' group by C order by sum(F) desc")</code></p>
  
  <p>I tried to do this but I get Parse Error:</p>
  
  <pre><code>=QUERY(INDIRECT("Overview!L5")!A2:F;"select C, sum(F) where A='December' group by C order by sum(F) desc")
  </code></pre>
  
  <p>In which Overview!L5 is the cell with sheet name to query. I also tried to concatenate quotes around INDIRECT but that didnt work either.</p>
  
  <p>I think it is quite evident what I am trying to do from the query i.e. get sum of values in cells grouped by values in other cells.</p>