title: conditional average in excel
body: <p>I have an excel sheet where these are the columns:</p>
  
  <p><code>% of contract value = c(4,3,5,6)</code> </p>
  
  <p><code>contract type = c("sell", "sell", "sell", "buy")</code></p>
  
  <p><code>confidence = c(5, 3, 3, 3)</code>.</p>
  
  <p>I would like to do a conditional average as follows:</p>
  
  <p>take the average of <code>% of contract value</code> but only for rows where <code>contract type = "sell"</code> and <code>confidence = 3</code>.</p>
  
  <p>In other words the answer to this should be <code>(3 + 5)/2 = 4</code></p>
  
  <p>Is there an easy way to do this in excel????</p>