# SolvedFinding the mean of Students based on mean of subjects (1 Viewer)

#### mercystone

##### Member
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
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``

Thanks.

#### mercystone

##### Member
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
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
Just FYI to others, in case thread is related to your previous one.

#### mercystone

##### Member
Just FYI to others, in case thread is related to your previous one.

#### theDBguy

##### I’m here to help
Staff member
Oops, sorry, my mistake. I hope you were able to pick up something useful from that thread, at least.

Cheers!

Replies
3
Views
213
Replies
3
Views
167
Replies
7
Views
505
Replies
7
Views
499
Replies
5
Views
173