hey guys can you'll kindly assist me, I'm trying to create the formular that will be set on date control default as a due date, due date is two weeks from current date.
If you want to return a date that's 10 working days from today (ie, 2 weeks excluding weekends), this is the formula that you would use.
With({ startDate:Now(),
daysToAdd: 10
},
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)
)
)
how can i exclude weekends for my due date
Hi @swelihle
This will give you the date that is 2 weeks from today:
DateAdd(Now(), 14, TimeUnit.Days)
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.