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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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:
  • 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,747 Moderator 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 248 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 192 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard