Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a requirement, to calculate the business working hours between two Dates that exclude Saturday and Sunday .
Consider the below example,
Start Date/Time Stamp , (Date Received) Friday Night 9.00 PM (17.03.2017 9.00 PM),
End Date/Time stamp ,(Process Date) Monday Morning 10.00 AM (20.03.2017 10.00 AM)
Now I want to calculate the time difference between 9.00 PM to 10.00 AM(not considering the Saturday and Sunday (48 hours)).
The result would be 13.00 Hours.
Thanks in Advance!
Regards,
Sharanya
Will it be work ?
= Interval(
rangesum(
NetWorkDays([Date Received+1,[Process Date]-1) * 1 // 24 hours per workday, for all day inbetween the period, excluding bounderies
,if(NetWorkDays([Process Date],[Process Date]), frac([Process Date]),0) // working hours last day
,if(NetWorkDays([Date Received,[Date Received),1-frac([Date Received),0) // working hours first day
,if(NetWorkDays([Date Received,[Date Received) and floor([Date Received)=floor([Process Date]),-1 ) // correct for first equals last day
), 'hh:mm:ss ')
use this function
networkingdays()
networkdays (start:date, end_date {, holiday})
Returns the number of working days (Monday-Friday) between and including start_date and end_date taking into account any optionally listed holidays. All parameters should be valid dates or timestamps.
Examples:
networkdays ('2007-02-19', '2007-03-01') returns 9
networkdays ('2006-12-18', '2006-12-31', '2006-12-25', '2006-12-26') returns 8
Take a peek here, assuming you can do this in the script of course
Hi Avinash,
Thanks for your reply
Calculation difference should be in time stamp (HH:MM:SS)
Will it be work ?
= Interval(
rangesum(
NetWorkDays([Date Received+1,[Process Date]-1) * 1 // 24 hours per workday, for all day inbetween the period, excluding bounderies
,if(NetWorkDays([Process Date],[Process Date]), frac([Process Date]),0) // working hours last day
,if(NetWorkDays([Date Received,[Date Received),1-frac([Date Received),0) // working hours first day
,if(NetWorkDays([Date Received,[Date Received) and floor([Date Received)=floor([Process Date]),-1 ) // correct for first equals last day
), 'hh:mm:ss ')