• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Difference between two dates with hours for weekdays only

Achyuth

New Member
Hi,

I have two date with Date Time formats like these 5/8/2018 4:20:00 AM & 5/25/2018 4:30:00 AM,

so i need a formula to fine the number of working days(5 days) between these dates which includes hours too. like if the difference between them is 1 and a half day the value should be 1.5, or else if the difference between them is 15 days and lets say 6 hours the value should like 15.3 or 15.4 some rational value to find the exact difference between these dates which exclude weekends.

Thanks for your help in advance.

Regards,
Achyuth
 
This perhaps?
= NETWORKDAYS.INTL(StartDate,EndDate,[weekend],[Holidays])+ MOD (StartDate - EndDate , 1 )

If your weekends are Saturday-Sunday then [weekend] is just 1.
[Holidays] is a list of holidays date if applicable (I usually have them sitting in a separate table).
MOD returns the remainder after division and thus returns the time difference only.
It might need a tweak, because Fx networkdays returns 1 even when start and end date are the same date on a weekday.
What would the correct result be if your start date is in a weekend and the end date is on the first working day, but only six hours later. Would it be 1.4 or 0.4?

Have a look at Excel Magic Trick 533: Date/Time Calculation excluding Holidays & Weekends on YouTube
 
Back
Top