Custom Function that calculates Average

I need to calculate the average of 2 columns shown in the below screenshot. Though when im trying the PHP function its throwing no results.Kindly help.

The formula is Revised PD Duration second one divided by Chapter Count. What is the SQL formula/PHP formula to calculate the same.

Please help