Calculation of average value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi I have on a form something that resembles this.

A B C Average
1 1 1 1
2 2 2 2

Basically, using code ie. clicking a button I want to be able to average the
A1, B1, C1 and put them into Average 1 ... then average row 2.... and so on


any suggestions?
 
You will need to write your own function to do this.

Perhaps you could use the MinOfList() function as a model for how to pass in
any number of fields, ignore the nulls or non-numeric values, and count and
sum the valid numeric values in a loop to get the average:
http://allenbrowne.com/func-09.html

As that article points out, the reason Access does not provide this for you
is that it is not the right way to design a database table. For more info
about that, search for "normalization" and "repeating" fields. Here's a
starting point for finding some articles on database design:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html#DatabaseDesign101
 
Back
Top