Yes, you'll need to find the mid-point of each class. For example, you've got 8 students who scored an average of 4.5 (the total of their marks is 8x4.5 or 36) and another 20 students who scored an average of 14.5 (the total of these students' marks is 20x14.5 or 290). Simply total up ALL the students' marks.