The formula used in the sheet will cause circular reference. So you need to enable Iterative Calculation. To do so Click on the Office Logo (top left of the spread sheet) --> Excel Options --> Formulas --> Under the Calculation Options --> Check the box before Enable Iterative Calculations.
Grace columns between columns H and AL will have the following formula.....
In H8
=IF(SUM($G8>=35,$M8>=35,$S8>=35,$Y8>=35,$AE8>=35,$AK8>=35,$AQ8>=18,$AW8>=18,$BC8>=18)>=3,IF(G8<35,IF($BL8>=35-G8,35-G8,0),0),0)
and then copy down.
For Grace columns between columns AR and BD
In AR8
=IF(SUM($G8>=35,$M8>=35,$S8>=35,$Y8>=35,$AE8>=35,$AK8>=35,$AQ8>=18,$AW8>=18,$BC8>=18)>=3,IF(AQ8<35,IF($BL8>=18-AQ8,18-AQ8,0),0),0)
and then copy down.
Since this formula is comparing marks of Average column which is average of two tests of a subject i.e. (Test1+Test2)/2, you will need to double the grace marks in order to make him pass.
Take the example of G13 in Average column. It has 34 so it seems it is only 1 less than the passing marks 35. But since this is average of Test A = 23 (D13) and Test B = 45 (E13) which tells that this student is passed in Test B but failed in Test A as he has got only 23. So when you average these two test's marks you get 34 [(23+45)/2] but to get average of 35 he must have the total of 70 in these two tests so in fact you need to add 2 in the total of Test A and Test B to get the average of 35 i.e. [((23+2)+45)/2]. That is my assessment. If you think it is correct, you will need to make a change in the formulas suggested above like.....
In H8
=IF(SUM($G8>=35,$M8>=35,$S8>=35,$Y8>=35,$AE8>=35,$AK8>=35,$AQ8>=18,$AW8>=18,$BC8>=18)>=3,IF(G8<35,IF($BL8>=(35-G8)*2,(35-G8)*2,0),0),0)
Same way you will need to change the formula for last three subject.
Notice the column BL, there I am using a formula to hold the max grace marks left for a student.
In BL8
=15-SUM(H8,N8,T8,Z8,AF8,AL8,AR8,AX8,BD8)
and copy down.
As per your conditions only two students have got grace marks. Test the formulas with more set of data to see if you are getting the desired results.
Bookmarks