Microsoft KB Archive/242177

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

Article ID: 242177

Article Last Modified on 1/25/2007

-

APPLIES TO


 * Microsoft Works 2000 Standard Edition
 * Microsoft Works 6.0
 * Microsoft Works Suite 2000
 * Microsoft Works Suite 2001

-



This article was previously published under Q242177



SUMMARY
This article describes how to calculate a running total or a running average in a Microsoft Works database.

A running total or running average displays the sum or average of all of the values in a specific field up to the current record. In a Works database, you can use a self-referencing formula to calculate a running total or a running average.



MORE INFORMATION
To create a sample database that calculates running totals and averages:

 In a new Works database, create the following four new fields, and then click Done:  Values Number Total Average  On the View menu, click List.</li> In the first record: <ol style="list-style-type: lower-alpha;"> In the Values field, type 20 .</li> In the Number field, type 1 .</li> In the Total field, type the number located in Values .</li> In the Average field, type the following formula:

=Total/Number

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

=Number+IF(Values,1,0)

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

=Total+Values

</li></ol> </li> Type the following values in the Values field in the next four records:  0</li> 60</li> 80</li> 100</li></ul> </li></ol>

As you type new values in the Values field, the values in the Number, Total, and Average fields are calculated automatically. The following table shows the results.

NOTE: Blank values in the Value field are not counted in the Average field.

Additional query words: w_works works2k w2001 recursive accumulative cumulative

Keywords: kbfaq kbhowto kbui KB242177

-

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

© Microsoft Corporation. All rights reserved.