Skip to main content
Question

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

  • Oct 30, 2013 11:31 PM UTC
  • 0 replies
  • 84 views

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)?
This topic has been closed for replies.

  • Observing
  • Nov 19, 2013 9:46 PM UTC
The WeekDayAdd function outlined here: https://www.quickbase.com/db/6ewwzuuj?a=dr&r=e7&rl=df3 would accomplish that.

  • Observing
  • Nov 19, 2013 9:49 PM UTC
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.