cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Mrunal
Level: Powered On

Date Difference excluding Weekends

If I want to calculate difference between two dates excluding weekend(Saturday, Sunday). How to achieve this? Suggest some help.

1 ACCEPTED SOLUTION

Accepted Solutions
Steelman70
Level 10

Re: Date Difference excluding Weekends

Here is the screenshot and formulas for each line below, frankly it should be possible to simplify but I could not see how...

 

 

 

CaptureWeekDays.PNG

 

Date(2016,6,15)

 

Date(2016,6,27)

 

DateDiff(DateValue(Date1.Text, "it" ), DateValue(Date2.Text, "it" ))

 

Mod(CalDays.Text,7)

 

Mod(DateDiff(Date(2000,1,3), DateValue(Date1.Text, "it" )),7)+1

 

Weekday1.Text+CalDaysMod7.Text

 

If(CalDaysMod7.Text="0",0, If(Value(Weekday2x.Text) < 7, CalDaysMod7.Text, If(Weekday2x.Text="7", Max(CalDaysMod7.Text-1,0), CalDaysMod7.Text-Min(2,8-Weekday1.Text))))

 

RoundDown(CalDays/7,0)*5+ExtraDays

Basically it is whole weeks*5 plus an adjustment for the extra days depending on how many week-end days they include

View solution in original post

3 REPLIES 3
hngdev
Level 8

Re: Date Difference excluding Weekends

I think you can you use DateDiff function to do so:

- Use DateDiff with day unit > get days

- Use days to get weeks

- Multiply weeks by 2 for weekends

- Get days minus weekends

Hope it helps

Steelman70
Level 10

Re: Date Difference excluding Weekends

Here is the screenshot and formulas for each line below, frankly it should be possible to simplify but I could not see how...

 

 

 

CaptureWeekDays.PNG

 

Date(2016,6,15)

 

Date(2016,6,27)

 

DateDiff(DateValue(Date1.Text, "it" ), DateValue(Date2.Text, "it" ))

 

Mod(CalDays.Text,7)

 

Mod(DateDiff(Date(2000,1,3), DateValue(Date1.Text, "it" )),7)+1

 

Weekday1.Text+CalDaysMod7.Text

 

If(CalDaysMod7.Text="0",0, If(Value(Weekday2x.Text) < 7, CalDaysMod7.Text, If(Weekday2x.Text="7", Max(CalDaysMod7.Text-1,0), CalDaysMod7.Text-Min(2,8-Weekday1.Text))))

 

RoundDown(CalDays/7,0)*5+ExtraDays

Basically it is whole weeks*5 plus an adjustment for the extra days depending on how many week-end days they include

View solution in original post

Anonymous
Not applicable

Re: Date Difference excluding Weekends

Thanks for the post.It's working great!!!!!

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,561)