Thanks Guys for the good work. I am writing though with a small problem. I want to sum students grades based on the choices of subjects they made. The situation is like this: Sum three compulsory subjects (Group 1), Choose best two of two or three in group 2, choose best one of two or three in group three, and finally choose any one best subject from the remaining group 2 OR remaining group 3 OR any group 4 subjects. I will greatly apreciate your help.