Remove #Error! values from Custom Summary Formulas in Reports
Knowledge Article Number  000003362 

Description  The most common reason you'll find "#Error!" on a report cell is because of an error that happens when a formula has to divide a number by zero. NOTE: Currency fields, although displayed as blank on the record and report, will always enter a 0.00 value in any formula. 
Resolution  Fix #Error! values
"IF" statement considerations
For example, your custom summary formula is: IF( CLOSED:SUM = 0, 0, AMOUNT.CONVERT:SUM/CLOSED:SUM)
The grand total for your formula is different from the sum of the result of the formula for the records. This is due to the fact that the grand total is not the Sum of the numbers above, but is evaluating the formula at the summary level. As the Amount for the grand total is not equal to zero, the grand total will calculate at run time.
"AMOUNT.CONVERT:SUM/CLOSED:SUM" that in the example above is 500.000 / 4 = 125.000 and not (100.000+200.000 =) 300.000
