WORKDAYS
WORKDAYS(from, to, [calendar])
The working time between two dates, such as how much work time is left from the data date to a task's finish. It counts on the calendar of the task the date belongs to, so the same two dates can give a different answer on a 5-day task than on a 7-day one, and the result is a duration, negative when to is before from.
Arguments
| Argument | What to give it |
|---|---|
| from | A date, like DATADATE() or [Start date]. Blank gives blank. |
| to | A date. Blank gives blank. |
| calendar | Optional: a calendar's name in quotes, like "6-day", to count on that calendar instead. Left out, the count is on the calendar of the task from belongs to (else the one to belongs to); dates that belong to no task, like DATADATE() and TODAY(), count on the project's calendar. |
Examples
Formula=WORKDAYS(DATADATE(), [Finish date])
The working time from the data date to the task's finish, on the task's own calendar.
Formula=WORKDAYS([Finish date], IN(BASELINE(), [Finish date]))
How far the task's finish is ahead of its baseline finish in working time: negative when it has slipped past it.
Formula=WORKDAYS([Start date], [Finish date], "7-day") > 30
TRUE when the task spans more than 30 days of a 7-day week, whatever calendar it is on. A bare number here is working days.
Formula on relationships=WORKDAYS(Predecessor[Finish date], Successor[Start date])
On a relationship: the working time between the predecessor's finish and the successor's start.
Reach for something else when
| You want | Use |
|---|---|
| Calendar days, weekends and holidays included | CALDAYS |
| The date a given amount of work later | ADDWORK, or [Finish date] + 5d |
| The result as a plain number of days or hours | INDAYS or INHOURS |
Common questions
Why can't I just subtract two dates?
The difference could mean working time or calendar days, so the editor refuses it: Subtracting two dates is ambiguous. Use WORKDAYS(from, to) for working time or CALDAYS(from, to) for calendar days.
=[Finish date] - [Start date]
Why does WORKDAYS show 5d and not 5?
It gives a duration, shown in working days of the task's calendar. Compare it with 5d or a bare 5 (read as five of the task's working days), or wrap it in INDAYS for a number. See durations.
Why does the calendar have to be in quotes?
The calendar is fixed when the formula is saved, so the editor says WORKDAYS needs text in quotes here for a field like [Calendar]. To count on each task's own calendar, leave the calendar out. A name that isn't one of the project's calendars is refused with the list of the ones it could be, and renaming a calendar renames it in the formula.
=WORKDAYS([Start date], [Finish date], [Calendar])
