Skip to main content

Notifications

Community site session details
Power Apps - Building Power Apps
Answered

Date Difference excluding Weekends

Like (1) ShareShare
ReportReport
Posted on 2 Jun 2016 05:50:50 by

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

Categories:
  • Community Power Platform Member Profile Picture
    on 09 Nov 2016 at 14:04:36
    Re: Date Difference excluding Weekends

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

  • Verified answer
    Steelman70 Profile Picture
    873 on 02 Jun 2016 at 16:40:00
    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

  • hngdev Profile Picture
    304 on 02 Jun 2016 at 14:08:23
    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,079 Most Valuable Professional

Leaderboard
Loading started
Loading started
Loading complete