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 Apps
Unanswered

add business days

(0) ShareShare
ReportReport
Posted on by 1,257 Super User 2024 Season 1

I know there are a ton of posts on this ! but can't quite hit on the right one ... I use the following formula to add a set number of days to todays date.  I was told previously this would calculate business days (I'm not too worried about holidays at the moment it's just weekends I want to exclude) but it still gives me weekends !  any suggestions for tweaks?

 

 

 Text( DateAdd(
 DateToday,
 Value(SLA.Text) + 2 * If(
 (Weekday(
 DateToday,
 StartOfWeek.Monday
 ) + Value(SLA.Text)) > 5,
 RoundDown(
 (Value(SLA.Text) - (5-Weekday(
 DateToday,
 StartOfWeek.Monday
 ))) / 5,
 0
 ) 
 )
 ),DateTimeFormat.LongDate)

TIA

 

Categories:
I have the same question (0)
  • Verified answer
    timl Profile Picture
    36,383 Super User 2025 Season 2 on at

    Hi@vffdd 

    This is the formula I would use to add the value in your SLA textbox to the variable/field that you've defined as DateToday.

    Can you see if that produces the correct result?

    With({ startDate:DateToday,
     daysToAdd: Value(SLA.Text)
     },
     DateAdd(startDate, daysToAdd) + 
     RoundDown(daysToAdd/5, 0)*2 +
     Switch(Weekday(startDate, StartOfWeek.Monday),
     5,If(Mod(daysToAdd, 5)>0,2,0),
     4,If(Mod(daysToAdd, 5)>1,2,0),
     3,If(Mod(daysToAdd, 5)>2,2,0),
     2,If(Mod(daysToAdd, 5)>3,2,0),
     1,If(Mod(daysToAdd, 5)>4,2,0)
     )
    )

     

     

  • vffdd Profile Picture
    1,257 Super User 2024 Season 1 on at

    @timl  perfect that does it !  thank you

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard