Skip to main content
Question

How to exclude weekend days from a date formula field

  • Dec 9, 2017 1:57 AM UTC
  • 0 replies
  • 292 views

I have an old calculation that either I haven't been paying attention to in my tasks or seems to all of a sudden stopped working. I have a date formula field called Start Date with Check that is supposed to bring up the Start Date field but calculate a new date that is not on the weekend (so the next weekday) and this date field figures into several other date calculations. However, I noticed it is returning weekend days.

This is the formula I currently have: If(DayOfWeek([Start Date])=0, ToWorkDate(ToWeekdayN([Start Date])), ([Start Date]))

Any idea where I may be off?
This topic has been closed for replies.

  • Qrew Corporal
  • Dec 9, 2017 1:58 AM UTC
Give this a shot.

var Date StartTime = [Booked Date];
var  Number  NumWeekendDays = ToDays([SCHEDULED DATE] - ($StartTime))  - WeekdaySub ( [SCHEDULED DATE], ($StartTime) );

If([XMF Current Production Schedule Date]>[SCHEDULED DATE],ToDays([XMF Current Production Schedule Date]-[Booked Date])-($NumWeekendDays),ToDays([SCHEDULED DATE]-[Booked Date])-($NumWeekendDays))

  • Author
  • Observing
  • Dec 9, 2017 2:21 AM UTC
Well, that seems a lot more complicated than I expected with fields that I don't have and don't want to create if I don't have to. 

  • Qrew Corporal
  • Dec 9, 2017 2:24 AM UTC
OK - sorry, ignore me - I read the question too fast.  the equation above is for excluding weekends from a calculation of duration.

  • Author
  • Observing
  • Dec 9, 2017 2:26 AM UTC
No worries. It's a Friday afternoon, lol. But good to know for future applications. Just need and actual date that shows up that is not a weekend based on whatever the Start Date is. :)

Try this

WeekdayAdd([Start Date],0)

  • Quickbase Staff
  • Mar 21, 2019 5:18 PM UTC
It sounds like you got it figured out, but another formula component I find very useful in similar situations is IsWeekday(date d), which returns true if d is a weekday, otherwise false.