+ Start a Discussion
Sreenu Reddy 16Sreenu Reddy 16 

Weekdays exclude +

HI Viewers,
i have two  fields   converteddate__C(Date) and submittedDate__c(Date/Time)  in lead object and having  formula field Duration scince converted.Here "Dutation_since_converted =  converteddate__C - Datevalue(submittedDate__c) "..  i want  calculate only weekdays. i write a formula , i am getting  duration_since_converted. But i want exclude weeends in this ?How to wrt formula for exclude weekends can any one can help me please .

Thanks!
Sreeni sree
Alain CabonAlain Cabon
Hello,

The number of days between two dates without the week-ends is commonly called the number of business days in the documentation of Salesforce ( 5 days per week ).

Finding the Number of Business Days Between Two Dates:
(5 * ( FLOOR( ( date1__c - DATE( 1900, 1, 8) ) / 7 ) ) + MIN( 5, MOD( date1__c - DATE( 1900, 1, 8), 7 ) ) ) 
- 
(5 * ( FLOOR( ( date2__c - DATE( 1900, 1, 8) ) / 7 ) ) + MIN( 5, MOD( date2__c - DATE( 1900, 1, 8), 7 ) ) )

In this formula, date_1 is the more recent date and date_2 is the earlier date.  ( date_1 > date_2 )

https://developer.salesforce.com/docs/atlas.en-us.usefulFormulaFields.meta/usefulFormulaFields/formula_examples_dates.htm