title: Crystal Reports - Formula to count groups/How to create an average based on sums
body: <p>I am working on a report that shows Part Numbers with multiple Purchase Order numbers, Order Quantity and Shipped Quantity. First I grouped Part Numbers. </p>
  
  <pre><code>Part # 21104-2F    PO # S7CEO    Order Qty: 10    Shipped Qty: 0
                     PO # S7CEO    Order Qty: 10    Shipped Qty: 0
                     PO # S8LVU    Order Qty: 5     Shipped Qty: 0
  </code></pre>
  
  <p>Sometimes we split jobs within a purchase order. For example: (look above at PO # S7CEO) you order 20 of part # 21004-2F. We separate it into two lines (or jobs) of 10 parts per job. In this report I only want to see that you ordered 20. To achieve this, I created a second group for Purchase Order numbers and inserted a sum so that way I only see that you order 20 parts. </p>
  
  <pre><code>Part # 21104-2F    PO # S7CEO    Order Qty: 20    Shipped Qty: 0
                     PO # S8LVU    Order Qty: 5     Shipped Qty: 0
  </code></pre>
  
  <p>My dilemma: I need to show an average based on how many parts you ordered (so average of the 20 parts, not the 10) but CR is giving me an average based on the 10 parts. </p>
  
  <p>How do I create an average based on sums?</p>
  
  <p>I tried using a formula to calculate the sum then divide by line count. There are 3 “lines” but once I grouped and inserted a summary, there are 2 different purchase orders. The line count formula is counting "3" lines. I want it to count how many groups I have so it will come up with "2". Then I will be able to divide "groupcount" (2) by total order qty and that will give me an average. Is there a formula that will help me achieve this?</p>
  
  <p>Thank you in advance!</p>