# Discussions

View Only

## Due dates formula

• #### 1.  Due dates formula

Posted 09-06-2017 14:14
I need to set 4 due dates that will be based on number of days (End Date - Start date), divided by 5 which will make 5 periods of same length. And a due date is the first day of each period except the first one.

• #### 2.  RE: Due dates formula

Top
Contributor
Posted 09-06-2017 15:26
Try these five formulas:

`==========================================================[Due Date 1] formula:var Number NumDays = ToDays([End Date] - [Start Date]);var Number IntDays = Int(\$NumDays / 5);var Number RemDays = Rem(\$NumDays, 5);[Start Date] + Days(If(\$RemDays  = 0, 1 * \$IntDays,  1 * (\$IntDays + 1)))==========================================================[Due Date 2] formula:var Number NumDays = ToDays([End Date] - [Start Date]);var Number IntDays = Int(\$NumDays / 5);var Number RemDays = Rem(\$NumDays, 5);[Start Date] + Days(If(\$RemDays  = 0, 2 * \$IntDays,  2 * (\$IntDays + 1)))==========================================================[Due Date 3] formula:var Number NumDays = ToDays([End Date] - [Start Date]);var Number IntDays = Int(\$NumDays / 5);var Number RemDays = Rem(\$NumDays, 5);[Start Date] + Days(If(\$RemDays  = 0, 3 * \$IntDays,  3 * (\$IntDays + 1)))==========================================================[Due Date 4] formula:var Number NumDays = ToDays([End Date] - [Start Date]);var Number IntDays = Int(\$NumDays / 5);var Number RemDays = Rem(\$NumDays, 5);[Start Date] + Days(If(\$RemDays  = 0, 4 * \$IntDays,  4 * (\$IntDays + 1)))==========================================================[Due Date 5] formula:[End Date]`

• #### 3.  RE: Due dates formula

Posted 09-06-2017 16:18
Thank you sooo much!! I'd been working on it for ages and still couldn't figure out how to do it. Thanks again!