calculate average, excluding 0 values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to average a numeric field, but some records have a 0 in the
field and i don't want those fields to be counted as part of the denominator.
how do i do this?
 
In most headers or footers, you can use an expression like:
=Sum([YourNumberField]) / Sum( [YourNumberField] <> 0 )
You may need to adjust for possible dividing by zero:
=IIf( Sum( [YourNumberField] <> 0 )=0,0,Sum([YourNumberField]) / Sum(
[YourNumberField] <> 0 ))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top