Excluding or Including values in a avg() calculation

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

I am calcualting and average in a text box on a report.
The field resides in a query. Currently the syntax I am
using is:

avg([field1])

What I would like to do is produce an average only when
[field1] is a 1-5

Any help would be greatly appreciated

P.S. I am also calculating a Std. Dev on the same field
and would need to apply the same parameter
 
Bill said:
I am calcualting and average in a text box on a report.
The field resides in a query. Currently the syntax I am
using is:

avg([field1])

What I would like to do is produce an average only when
[field1] is a 1-5

Any help would be greatly appreciated

P.S. I am also calculating a Std. Dev on the same field
and would need to apply the same parameter


Try =Avg(IIf(field1 >=1 And field1 <=5, field1, Null))
 
Back
Top