title: Summarize grouping by year and month
body: <p>I have a worksheet <em>Movements</em> with two fields:</p>
  
  <pre><code>mydate      | amount
  2009-01-01  | 10.00
  2009-01-02  | 13.00
  2009-02-01  | 11.00
  2009-02-05  | 12.00
  2009-02-08  | 52.00
  </code></pre>
  
  <p>I want to have in another worksheet <em>MonthSum</em> that displays the sums of the data in the column <em>amount</em> grouped by year+month of the column <em>date</em>:</p>
  
  <pre><code>mydate      | amount
  2009-01     | 23.00
  2009-02     | 75.00
  </code></pre>
  
  <p>I don't want to specify the cells where the spreadsheet has to sum, I want a generic formula to group my data per month+year. If I was on a MySQL database I would simply do:</p>
  
  <pre><code>SELECT DATE_FORMAT('%Y-%m', mydate), SUM(amount) 
  FROM mytable GROUP BY DATE_FORMAT('%Y-%m', mydate)
  </code></pre>
  
  <p>I need the solution to work on <strong>Google Spreadsheets</strong>.  </p>
  
  <p>I think that possible solutions would be using SUMIF or pivot tables or Google Spreadsheets QUERY <a href="https://docs.google.com/support/bin/answer.py?answer=1388882" rel="noreferrer">function</a>.</p>