web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Calculate number of sa...
Power Apps
Unanswered

Calculate number of saturdays and sundays between two dates

(0) ShareShare
ReportReport
Posted on by

Hi all, 

 

I have two datepickers, one for the start date of a project and one for the end date. Now I need to determine the number of saturdays and sundays between these two days, because additional costs apply here. However I don't know how to calculate it.

I hope someone can help me!

 

Kind regards

Categories:
I have the same question (0)
  • Verified answer
    madlad Profile Picture
    2,637 Moderator on at

    Hi! This will find the count of saturdays and sundays in between your 2 selected dates, and store it as a variable "SatSunCount", and can be relatively easily modified to get other information from between these 2 dates:

    Set(
     SatSunCount,
     CountIf(
     ForAll(
     Sequence(
     DateDiff(
     DatePicker1.SelectedDate,
     DatePicker2.SelectedDate
     )
     ),
     Text(
     DatePicker1.SelectedDate + Value,
     "dddd"
     )
     ),
     ThisRecord.Value = "Saturday" || ThisRecord.Value = "Sunday"
     )
    )

     

    Hope this helps!

  • Rajkumar_M Profile Picture
    3,741 Super User 2025 Season 2 on at

    Hi,

    Try this formula in label text property

    Rajkumar_404_0-1688735603994.png

     

    RoundDown(DateDiff(DatePicker1.SelectedDate, DatePicker2.SelectedDate, TimeUnit.Days) / 7, 0) * 2 +
    If(Weekday(DatePicker1.SelectedDate) = 1, 1, 0) +
    If(Weekday(DatePicker1.SelectedDate) = 7, 1, 0) +
    If(Weekday(DatePicker2.SelectedDate) = 1, 1, 0) +
    If(Weekday(DatePicker2.SelectedDate) = 7, 1, 0)

     


    Thanks!

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.



  • TheRobRush Profile Picture
    11,128 Moderator on at
    CountIf(
     ForAll(
     Sequence(DateDiff(DatePicker1.SelectedDate, DatePicker2.SelectedDate,TimeUnit.Days)+1,0,1) As dateRange, 
     DateAdd(DatePicker1.SelectedDate,dateRange.Value,TimeUnit.Days)
     ),
     Weekday(Value)=1 || Weekday(Value)=7
     )

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard