I am going ahead and uploading this as I will be away for a few days.
In the attached file A7:A13 have been changed and the formatting applied so that they appear to be the text entries that were there before.
The following formula is applied to row 17:
Formula:
=IF(SUM($A17:A17)>=40,0,IF(SUM(SUMPRODUCT(($A7:$A13=B16)*($F7:$F13)),$A17:A17)>40,40-SUM($A17:A17),SUMPRODUCT(($A7:$A13=B16)*($F7:$F13))))
The following formula is applied to row 18:
Formula:
=SUMPRODUCT(($A7:$A13=B16)*($F7:$F13))-B17
The following formula is applied to row 20:
Formula:
=IF(SUM($A20:A20,B17)>40,40-SUM($A20:A20),ROUND(B17,1))
The following formula is applied to row 21:
Formula:
=ROUND(SUM(B17-B20,B18),1)
Let us know if you have any questions.
Bookmarks