Forum Discussion

JosueJosue's avatar
JosueJosue
Qrew Member
11 years ago

How can you add a function to a formula to only include weekdays and/or business hours for a duration?

Is there a function name that can be added to a formula that will return duration that excludes weekends and/or only counts business hours (8AM-6PM for example)?

4 Replies

  • If you have a Formula - Date field, in the formula you can use the WeekdaySub(finishDate, startDate) function.

    From there, you could get the number of hours by multiplying the number of days by the number of hours in the day.

    Does that help get what you want?

    WeekdaySub (Date d2, Date d1)

    Description: Returns the number of weekdays in the interval starting with d1 and ending on the day before d2 (same as subtracting Dates, but the result is the number of weekdays instead of a Duration). It is the inverse of WeekdayAdd.

    Example: WeekdaySub([Finish], [Start]) returns the number of weekdays between the dates in the Start and Finish fields.

    WeekdaySub(ToDate("6/24/2003"), ToDate("6/20/2003") ) returns 2
  • I couldn't get this to work as a Formula - Date field. Had to use a Formula - Numeric.
    • AlexCertificati's avatar
      AlexCertificati
      Qrew Cadet
      That's right.

      WeekdaySub([Finish], [Start]) returns the number of weekdays