title: Find mean of values in one column, that share a common value in two other columns
body: <p>I have a dataset that <a href="https://i.stack.imgur.com/GAtr5.png" rel="nofollow noreferrer">looks like this</a>:</p>
  
  <pre><code>   year month quarter measurement
  1  2005     1       1          33
  2  2005     2       1           5
  3  2005     4       2           3
  4  2005     5       2           7
  5  2005     6       2          10
  6  2005     7       3           4
  7  2005    10       4           9
  8  2005    10       4           6
  9  2005    11       4           8
  10 2005    11       4           9
  11 2005    11       4           3
  12 2005    11       4           9
  13 2005    11       4           2
  14 2006    11       4           1
  15 2006    12       4           1
  16 2006    12       4           6
  17 2006     1       1           9
  18 2006     1       1           1
  19 2006     1       1          10
  20 2006     7       3           2
  21 2006     1       1           0
  22 2007     4       2           3
  23 2007     1       1           4
  24 2007     2       1           5
  25 2007     2       1           1
  26 2007     8       3           5
  27 2007     9       3           6
  28 2007     2       4           6
  </code></pre>
  
  <p>I'd like to take the mean of all the values that share the same year value (column 1) and quarter value (column 3). The mean calculations would be performed on the measurement values (column 4). The month column (column 2) can be ignored-- I included it to show why I may have multiple Quarter 1 values for a single year. </p>
  
  <p>I don't think I can use a rolling average formula, as there's a different amount of Quarter values for different years. </p>
  
  <p>I believe I'd like to format my data like this: </p>
  
  <p><a href="https://i.stack.imgur.com/OqHsi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OqHsi.png" alt="quarter mean for the measurements, sorted by year"></a></p>
  
  <p>Thank you</p>