Skip to main content
The Formula works and performs the calculations as expected when a user is within the parameters, however, when the user works outside of the parameters it gets crazy.

 

The user submitted a case after hours and completed it before the established start time.

 

Formula to calculate business hours between two date/time fields, abnormalities occur when working outside of parameters

 

11.5 * (

( 5 * FLOOR( ( DATEVALUE( First_Contact_Date_Time__c ) - DATE( 1900, 1, 8) ) / 7) +

MIN(5,

MOD( DATEVALUE( First_Contact_Date_Time__c ) - DATE( 1900, 1, 8), 7) +

MIN( 1, 24 / 11.5 * ( MOD( First_Contact_Date_Time__c - DATETIMEVALUE( '1900-01-08 12:30:00' ), 1 ) ) )

)

)

-

( 5 * FLOOR( ( DATEVALUE( CreatedDate ) - DATE( 1900, 1, 8) ) / 7) +

MIN( 5,

MOD( DATEVALUE( CreatedDate ) - DATE( 1996, 1, 8), 7 ) +

MIN( 1, 24 / 11.5 * ( MOD( CreatedDate - DATETIMEVALUE( '1900-01-08 12:30:00' ), 1) ) )

)

)

)*60

We have the start time as 8:30 AM EST, with an 11.5 hour day, it's working perfectly when a user works within the parameters.

 

Is there a way to fix this? ultimately return a "0" when they work outside the 8:30 AM - 8:00 PM schedule?
1 Antwort
0/9000