Access 2003 - Average formula required?

R

RocketMan

Access 2003 - Average formula required?
I have multiple values in a report and I need to add an average amount in a
totals column at the bottom of the page.

The values I need to average are written in Text 35

Can anyone show me the formula that I need to put into my new totals box
Control Source to get the average?

Thanks
 
W

Wayne-I-M

Hi

Add a text box to the group's footer / header (if you are working with
groups) or into the report footer or header.
Control source is

=Avg([ControlName])
 
R

RocketMan

=Avg([ControlName])

ControlName = ?
Is it the name of the fields that I need to Average? They are wrote in Text
35 (the set name of the text box) as this total is a formulated total from
other values on the form.

Wayne-I-M said:
Hi

Add a text box to the group's footer / header (if you are working with
groups) or into the report footer or header.
Control source is

=Avg([ControlName])

--
Wayne
Trentino, Italia.



RocketMan said:
Access 2003 - Average formula required?
I have multiple values in a report and I need to add an average amount in a
totals column at the bottom of the page.

The values I need to average are written in Text 35

Can anyone show me the formula that I need to put into my new totals box
Control Source to get the average?

Thanks
 
J

John W. Vinson

=Avg([ControlName])

ControlName = ?
Is it the name of the fields that I need to Average? They are wrote in Text
35 (the set name of the text box) as this total is a formulated total from
other values on the form.

You'll need to recapitulate the formula in the Avg expression, e.g.

=Avg([ThisField] * [ThatField] + [Extrafield])

The expressions in aggregate calculations in the form footer must be based on
fieldnames from the form's Recordsource, not on control names on the form. It
may be preferable to do the "formulated total" as a calculated field in the
Query upon which the form is based, rather than in the Control Source of [Text
35]; and it would CERTAINLY be a good idea to give controls meaningful names,
for your own benefit when you try to maintain the database later!
 
A

a a r o n _ k e m p f

uh.. Sometimes you want to do someting like this

Avg(NullIf(TheField, 0))

otherwise-- your average might be too low.

I think that you might be able to do the same thing with Jet like this
(but it's a lot less efficient)

Avg(Iif(TheField<>0, TheField, Null))


=Avg([ControlName])

ControlName = ?
Is it the name of the fields that I need to Average? They are wrote in Text
35 (the set name of the text box) as this total is a formulated total from
other values on the form.

Wayne-I-M said:
Add a text box to the group's footer / header (if you are working with
groups) or into the report footer or header.
Control source is
=Avg([ControlName])
"RocketMan" wrote:
 

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