Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

Calculating work date differences for due dates

Topic Labels: Formulas
Solved
Jump to Solution
290 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Emily_McLain
5 - Automation Enthusiast
5 - Automation Enthusiast

I'm using a simple formula to calculate the due date difference between today and the project due date:

WORKDAY_DIFF(TODAY(), {Due Date})-1
Which works for anything due today and in the future, but does not calculate properly for past due things. If today is 11/19, something due 11/18 should be Past Due by -1, but it shows -3. Given that it works for current/future dates, what am I missing here for the past dates?
 
 Screen Shot 2024-11-19 at 8.49.27 AM.png

 

1 Solution

Accepted Solutions
TheTimeSavingCo
18 - Pluto
18 - Pluto

WORKDAY_DIFF outputs "1" for the difference between the same day, so one day ago outputs "-2", your formula then does a "-1", so it's doing "-2-1", resulting in "-3"

Try using an IF to handle it, and here's an example where "TODAY()" is harcoded as a field:

 

IF(
  WORKDAY_DIFF(
    Date,
    {TODAY()}
  )>0,
  WORKDAY_DIFF(
    Date,
    {TODAY()}
  ) - 1,
  WORKDAY_DIFF(
    Date,
    {TODAY()}
  ) + 1
)

 

Screenshot 2024-11-20 at 9.33.52 AM.png

See Solution in Thread

1 Reply 1
TheTimeSavingCo
18 - Pluto
18 - Pluto

WORKDAY_DIFF outputs "1" for the difference between the same day, so one day ago outputs "-2", your formula then does a "-1", so it's doing "-2-1", resulting in "-3"

Try using an IF to handle it, and here's an example where "TODAY()" is harcoded as a field:

 

IF(
  WORKDAY_DIFF(
    Date,
    {TODAY()}
  )>0,
  WORKDAY_DIFF(
    Date,
    {TODAY()}
  ) - 1,
  WORKDAY_DIFF(
    Date,
    {TODAY()}
  ) + 1
)

 

Screenshot 2024-11-20 at 9.33.52 AM.png