title: C# LINQ Ignoring empty values in datatable
body: <p>I have a datatable that I have grouped as follows:</p>
  
  <pre><code>var result = from data in view.AsEnumerable()
                       group data by new {Group = data.Field&lt;string&gt;("group_no")}
                       into grp
                       select new
                       {
                           Group = grp.Key.Group,
                           PRAS = grp.Average(c =&gt; Convert.ToDouble(c.Field&lt;string&gt;("pAKT Total")))
  
                       };
  </code></pre>
  
  <p>Now, the average function is also counting the empty cells in it's calculation. For example, there are 10 cells with only 5 populated with values.  I want the average to be the sum of the 5 values divided by 5.</p>
  
  <p>How can I ensure that it does what I want?</p>
  
  <p>Thanks.</p>