Solved Finding the mean of Students based on mean of subjects (1 Viewer)

mercystone

Member
Local time
Today, 08:17
Joined
Sep 20, 2021
Messages
108
I have database of 50 Students. Students can select and do subjects which they wish. I have 5 subjects namely SUBJECT A, SUBJECT B, SUBJECT C, SUBJECT D, SUBJECT E. I know the easiest way of finding class mean is =Avg([Marks]). However, I want add mean of subjects done, add the mean and divide by the subjects done.
E.g mean of Subject A+ mean of Subject B + Subject C / 3 Subjecs which were done. Help me please
 

plog

Banishment Pending
Local time
Today, 00:17
Joined
May 11, 2011
Messages
10,919
However, I want add mean of subjects done, add the mean and divide by the subjects done.

You gotta be real careful with your words. No where in there did you use the phrase "by student". What you specifically asked for is to take the average of each subject's total average. You did not ask for the average of every student's average. So I will be telling you how to calculate the average of the subject's total average.

You will need a subquery:

Code:
SELECT Subject, AVG(Mark) AS SubjectAverage FROM Marks GROUP BY Subject

Name that 'sub1'. That will give you the average of each subject for every student. Then you use it as the basis for another query:

Code:
SELECT AVG(SubjectAverage) AS TotalSubjectAverage FROM sub1
 

mercystone

Member
Local time
Today, 08:17
Joined
Sep 20, 2021
Messages
108
I am trying to filter but it still gives me the report the way it is. I want to filter per the Student
 

plog

Banishment Pending
Local time
Today, 00:17
Joined
May 11, 2011
Messages
10,919
I explicitly stated that what you want is entirely predicated on a first averaging by subject which makes doing anything by student after that impossible.

Please demonstrate what you want with data. Provide 2 sets:

A. Starting data. Include table and field names and enough sample data to cover all cases.

B expected results. Show what data you expect to ennd up with based on the data in A.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:17
Joined
Oct 29, 2018
Messages
18,992
Just FYI to others, in case thread is related to your previous one.

 

Users who are viewing this thread

Top Bottom