In Access what expression do I use to average a field ignoring 0?

D

Dan Test

I have a report that calculates the average of a requested field. The average
is not correct due to "0" values in some of the records. What expression do I
use in the Control Source to ignore the 0 entries? I tried to adapt the one I
use in Excel but did not get the results I was looking for.
Thanks for the help.
 
J

Jeff Boyce

Consider stepping back and doing the selection and averaging in a query on
which you then base your report.

If you don't wish to include rows whose value in the field is 0, exclude
them from the query.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

John Spencer

If you want zero excluded from the calculation, then use a formula like

Avg(IIF(SomeField=0,Null,SomeField))




'====================================================
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
'====================================================
 

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

Top