Skip to main content
Solved

How to calculate a Date plus or minus a certain number of days

  • May 25, 2019
  • 2 replies
  • 112 views

Forum|alt.badge.img

Hi all,
I’m sure I’m just missing something easy but here is my problem. I have an employee start date field and a field with numbers of days. I have tasks that need to be done 5 days before the employee starts, 1 day before the employee starts, and so on and so forth. So I want to calculate a field using the Start Day and Number of Days to calculate the Due Date of the task based upon number of days.

So if my start date is 6/20/19 and my Number of days field is -5, I want a formula to return 6/15/19. I have tried the formula below but I get NaN returned. Thanks for any guidance and help!

DATETIME_FORMAT({Start Date},‘MM/DD/YY’)+{Number of days}

Best answer by Justin_Barrett

Date calculations are done using the DATEADD function. In your case, the formula would be:

DATETIME_FORMAT(DATEADD({Start Date}, {Number of days}, 'days'), 'MM/DD/YY')

Full function reference is here:

2 replies

Justin_Barrett
Forum|alt.badge.img+21
  • Inspiring
  • 4647 replies
  • Answer
  • May 25, 2019

Date calculations are done using the DATEADD function. In your case, the formula would be:

DATETIME_FORMAT(DATEADD({Start Date}, {Number of days}, 'days'), 'MM/DD/YY')

Full function reference is here:


Forum|alt.badge.img
  • Author
  • New Participant
  • 3 replies
  • May 27, 2019

Date calculations are done using the DATEADD function. In your case, the formula would be:

DATETIME_FORMAT(DATEADD({Start Date}, {Number of days}, 'days'), 'MM/DD/YY')

Full function reference is here:


Thank you so much! That worked!