A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

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



 
 
Thread Tools Display Modes
  #1  
Old July 30th, 2007, 10:26 PM posted to microsoft.public.access.reports
Dan Test
external usenet poster
 
Posts: 1
Default In Access what expression do I use to average a field ignoring 0?

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.
  #2  
Old July 30th, 2007, 11:17 PM posted to microsoft.public.access.reports
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default In Access what expression do I use to average a field ignoring 0?

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

"Dan Test" Dan wrote in message
...
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.



  #3  
Old July 31st, 2007, 01:13 AM posted to microsoft.public.access.reports
John Spencer
external usenet poster
 
Posts: 2,364
Default In Access what expression do I use to average a field ignoring0?

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
'================================================= ===


Dan Test wrote:
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.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.