How to found avg for 2 or 3 marks?

J

Jon

Greeting,

I have 4 text boxes for showing marks and I have a text box for calculating
the average for all of them by dividing by 4. The problem is some time I have
3 marks and some time I have only 2 marks. The question is, how to make
access divides by 3 in case of 3 text boxes and by 2 in case of 2 text boxes?

Any help please?
 
T

Tom Wickerath

Hi Jon,

The fact that you are needing to calculate statistics across fields within a
row indicates a high likelihood that your database is not properly
normalized. When you have multiple columns dedicated for entering similar
data, you've got what is known as a multi-valued field design. A classic
example is sales by month. For example:

JanSales FebSales MarSales AprSales....etc.

This type of a design requires you to add a field in order to track yet
another "similar" type of data.

Fields are expensive
Records are cheap

If tracking a new, similar quantity would require you to add a field, you
might want to revisit your database design. Here is a good link with several
DB design papers. If nothing else, read the first two by Michael Hernandez:

http://www.accessmvp.com/JConrad/accessjunkie/resources.html#DatabaseDesign101

That said, here is a Microsoft Knowledge Base (KB) article that looks like
it has what you need (disregard the "ACC2000" in the title:

How to Calculate Row-Level Statistics
http://support.microsoft.com/kb/209839


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________
 

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