title: Calculating a weighted average for a group
body: <p>I have a reports similar to the following:</p>
  
  <p><img src="https://i.stack.imgur.com/AvypS.png" alt=""></p>
  
  <p>I need it to look like the following:</p>
  
  <p><img src="https://i.stack.imgur.com/xwhkp.png" alt=""></p>
  
  <p>The report is grouped by Department. I cannot figure out how to create the formula field YTD AVG to calculate and show in each group footing and then reset for the next group.</p>
  
  <p>I understand the calculation for the YTD AVG, for example YTD AVG for dept1 would be:</p>
  
  <p>((80*100)+(100*40)) / (100+40)</p>
  
  <p>I just don't know how to get it in Crystal Reports.</p>