Weighted Average Calculation on Report

J

JimK

Hi, I'm generating an Access 2000 report off of information in a table. In
essence, the report lists the fields: Client, Pieces, and Cost. So I have a
report like:
Client Pieces Cost
ABC Co. 150 $198
XYZ Co. 380 $671
Test Inc. 275 $495
Totals 3 805 XXX
The "XXX" would be a weighted average of the Pieces count and the Cost. For
instance: (150/805 * $198) + (380/805 * $671) + (275/805 * $495) = $523.
However, I'm afraid I don't know how to "program" this type of formula into
the Totals line of my report. I'd appreciate whatever help folks could
provide. Thanks very much.
 
R

Ricoy-Chicago

I have a similar problem. My solution may not be neat but it worked.
In the detail Section add a text box with the following formula inside:

=([pieces]/[total pieces])*[Cost]

[total pieces] is the name of the box containing that total (probably in one
of your footer sections)

Go the the properties box for the text box you created. Go to the [ALL] tab
and make "visible"=no. Go to the [Data] tab and make "Running sum"= over group

Assume the name of this new box is [text XX]. Add a new text box in the
footer section where you want the weighted average to show and type in it:
=[text XX]

Again, it not the best but it works. Good luck.
 

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