Working on a GI to replicate some Excel reporting we are doing outside the system.
I am receiving an error on the Formula for “Margin in Backlog (%)” , the error is Divide by zero error encountered. Can anyone notice anything wrong with the below formula or another way to avoid the divide by zero error?
Thanks,
KT
Margin in Backlog (%) Formula
=100*((sum(IIf( uPMBudget.Type]=tRev] And ePMBudget.CuryRevisedAmount] <> 0, &PMBudget.CuryRevisedAmount], Null))-sum(IIf( uPMBudget.Type]=tRev] And ePMBudget.CuryActualAmount] <> 0, &PMBudget.CuryActualAmount], Null))-(sum(IIf( uPMBudget.Type]=tCost] And sPMBudget.CuryRevisedAmount] <> 0, &PMBudget.CuryRevisedAmount], Null))-sum(IIf( uPMBudget.Type]=tCost] And sPMBudget.CuryActualAmount] <> 0, &PMBudget.CuryActualAmount], Null))))/(sum(IIf( uPMBudget.Type]=tRev] And ePMBudget.CuryRevisedAmount] <> 0, &PMBudget.CuryRevisedAmount], Null))-sum(IIf( uPMBudget.Type]=tRev] And ePMBudget.CuryActualAmount] <> 0, &PMBudget.CuryActualAmount], Null))))
Page 1 / 1
@ketiller,
I think the issue is when the result of functions following the “/” will result in 0 if the Actual and Budget amounts are both the same therefore resulting in the divide by zero error. An option would be to add an initial comparison to see if the values are the same: