Microsoft KB Archive/124647

= Works: How to Calculate a Running Total/Average in a Database =

Article ID: 124647

Article Last Modified on 11/15/2004

-

APPLIES TO


 * Microsoft Works 4.0 Standard Edition
 * Microsoft Works 4.5 Standard Edition
 * Microsoft Works 4.5a
 * Microsoft Works 2.0a
 * Microsoft Works 3.0 Standard Edition
 * Microsoft Works 3.0a
 * Microsoft Works 3.0b

-



This article was previously published under Q124647



SUMMARY
A running total or average displays the sum or average of all the values in a specific field up to any given record. In Microsoft Works, you can keep a running total and a running average by using self-referencing formulas. The table below resembles a database that contains running totals and averages, in which blank values are not counted in the average.

To create a sample database similar to the one in this article, use the steps in the following procedure.



MORE INFORMATION
To create a table resembling the above example, do the following:

 In a new database, create 4 fields: Values, Number, Total, and Average. Switch to List view. In Record 1, type the following data (press ENTER after each entry):

 In the Values field, type 20 . In the Number field, type 1 . In the Total field, type the number located in Values . In the Average field, enter the following formula:

=Total/Number

</li></ol> </li> In Record 2, enter the following data:

<ol style="list-style-type: lower-alpha;"> In the Values field type, 40 .</li> In the Number field, enter the following formula:

=Number+IF(Values,1,0)

</li> In the Total field, enter the following formula:

=Total+Values

</li></ol> </li> Continue entering numbers above in the Values field.

At this point, every value entered in the Values field will automatically place the correct values in the following 3 fields.</li></ol>

A running total will be calculated in the Total field while a running average will be calculated in the Average field.

Additional query words: 2.00a 3.00 3.00a 3.00b 4.00 4.50 4.50a w_works recursion accumulative cumulative recursive

Keywords: kbhowto kbfaq KB124647

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.