the only way I compute a sum on a formula is through shared variables...you might be able to do a running total, that is DBlank's forte.
For a shared variable you will generally need 3 formulas.
1 to set the variable to zero:
shared numbervar aVar :=0;
1 to display the variable
shared numbervar aVar;
1 to increment the variable, this usually the hardest, but can be as simple as:
shared numbevar aVar;
if {table.field}=someCondition then
aVar := aVar + 1;
"" // this hides the calculations on the report.
HTH