It may help us better propose a resolution to the request if you provide a sample (manually calculated) of the output you would like to have automated.
Let us know if you have any questions.