I have hit a roadblock and I'm wondering if someone on the Communities can help me out. I am looking to have a formula that shows the business hours between the Actual End Date (BMCServiceDesk__Actual_End_Date__c) and Actual Start Date (BMCServiceDesk__Actual_Start_Date__c). I found the below link and started with that formula:
I have the formula modified now like the below code. We have a 9-hour work day (8 AM - 5 PM) and we are in the Central Time Zone, 6 standard hours or 5 daylight savings hours behind GMT (we’ll just use 6 in the formula). We also want to round the hours values to 2 decimal places.
MOD(DATEVALUE(BMCServiceDesk__Actual_Start_Date__c)-DATE(1996,01,01), 7) +
MIN(1, 24/9*(MOD(BMCServiceDesk__Actual_Start_Date__c-DATETIMEVALUE('1996-01-01 6:00:00'), 1)))
MOD(DATEVALUE(BMCServiceDesk__Actual_End_Date__c)-DATE(1996,01,01), 7) +
MIN(1, 24/9*(MOD(BMCServiceDesk__Actual_End_Date__c-DATETIMEVALUE('1996-01-01 6:00:00'), 1)))
In some cases, this returns the correct results...changes with no time difference (i.e. start and end both set to the same date and time, so it shows 0.00) or when the start and end are on the weekend (so it always shows 0.00). But when the times are on a weekday, whether within or outside of 8 AM - 5 PM CT, the calculation is not correct. Below are screen shots showing the Implementation Business Hours field using this formula and it is next to an Implementation Total Hours field (which is just Actual End Date - Actual Start Date). I also show the Actual Start and End fields for reference.
Can anyone help me modify the above formula to get the results documented in the below test cases?
Implementation Business Hours should be 0.00 hours (4:45 AM - 7:15 AM)
Implementation Business Hours should be 0.75 hours (4:15 PM - 5:00 PM)
* Now changed Start date to 4/18 to encompass a 2-day change window during workweek