Business Days Between Two DateTime Fields #inSalesforce

Business Days Between Two DateTime Fields #inSalesforce


(ROUND( 24 * (( 5 * FLOOR( ( DATEVALUE( endDateTimeField__c ) - DATE( 1900, 1, 8) ) / 7) + MIN(5,MOD( DATEVALUE( endDateTimeField__c ) - DATE( 1900, 1, 8), 7) + MIN( 1, 24 / 24 * ( MOD( endDateTimeField__c - DATETIMEVALUE( '1900-01-08 23:59:59' ), 1 )))))

-

( 5 * FLOOR( ( DATEVALUE( startDateTimeField__c ) - DATE( 1900, 1, 8) ) / 7) +MIN( 5,MOD( DATEVALUE( startDateTimeField__c ) - DATE( 1996, 1, 1), 7 ) + MIN( 1, 24 / 24 * ( MOD( startDateTimeField__c - DATETIMEVALUE( '1900-01-08 23:59:59' ), 1)))))),0 )) / 24


Visual: https://www.youtube.com/watch?v=ThLYTytOdN0

Comments