It is hard to explain this thru formula as it require a long explanation and debrief.
Essentially it is represented by a triangle, and the surplus is calculated thru the formula to calculate a Triangles height. That is (BASE x HEIGHT)/2
I have attached a link below. Please refer it for details.