If this formula is currently giving you the correct value, then rewrite the formula (written in the more accepted format) and add variables as follows:
whileprintingrecords;
Shared numberVar FallingTotCost;
Shared numberVar SkiddingTotCost;
Shared numberVar LoadingTotCost;
Shared numberVar ProcessingTotCost;
Shared numberVar LowBedTotCost;
Shared numberVar TotalFixed;
Numbervar costs := FallingTotCost + SkiddingTotCost + LoadingTotCost + ProcessingTotCost + LowBedTotCost + TotalFixed + {#RTotal};
Numbervar sumcosts := sumcosts + costs;
Numbervar cnt := cnt + 1;
costs;
Without knowing the group structure of your report, I don't know what "form footer" refers to. If this is a an outer group footer, then you need a reset formula in the form group header:
whileprintingrecords;
numbervar sumcosts;
numbervar cnt;
if not inrepeatedgroupheader then
(
sumcosts := 0;
cnt := 0
);
In the form group footer, add the following formula to get the average:
whileprintingrecords;
numbervar sumcosts;
numbervar cnt;
sumcosts/cnt;
If this does not work correctly, please provide the earlier requested information: your group structure with group fields identified, the location of your subreports, identification of the shared variable formulas within the subreports, and also the contents of formulas.
-LB