function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ganesh PrasathGanesh Prasath 

Override Divide by Zero Error

Hi Experts , 

   We have a scenario where we are required to report the YTD Budget achieved % (sum of sales every month / targets of months until the present month in a year) ,but we have numerous accounts without a target as well which results in the divide by zero sceantio. I've tried the below formula under a custom field called as %YTD Budget but I still do get the error , any help will be greatly appreciated

IF (((( July_16_Sales__c +     August_16_Sales__c +  MTD_Sales__c ) / ( July_16_Quota__c +  August_16_Quota__c + Sep_16_Quota__c )) <=0),
(( July_16_Sales__c +     August_16_Sales__c +  MTD_Sales__c ) / 1),
(( July_16_Sales__c +     August_16_Sales__c +  MTD_Sales__c ) / ( July_16_Quota__c +  August_16_Quota__c + Sep_16_Quota__c )))

Thanks
Ganesh
Matt SmelserMatt Smelser
Ganesh-
You should check to see if the divisor is equal to zero.
IF (
( July_16_Quota__c +  August_16_Quota__c + Sep_16_Quota__c ) =0,
( July_16_Sales__c +     August_16_Sales__c +  MTD_Sales__c ) / 1,
( July_16_Sales__c +     August_16_Sales__c +  MTD_Sales__c ) / ( July_16_Quota__c +  August_16_Quota__c + Sep_16_Quota__c ))