How do I get my date formula to stop at zero?

• 0
• Question
• Updated 1 year ago
So here is my current formula: WeekdaySub (ToDate([Training Start Date]), Today())

Once we're past the Training Start Date it calculates negative values, however I would like to stop it at 0 since there has been a request to add a notification.

I've played around with the formula (adding a ,0) but just cannot seem to get it to work.

Thanks in advance for the help!
• 300 Points

Posted 1 year ago

• 0
• 1,332 Points
Ron, you just need an if formula to set it to zero when it goes negative.  See the following as an example.

```var number daysTillTraining =  WeekdaySub(ToDate([Training Start Date]), Today());
If
(
\$daysTillTraining < 0
,0
,\$daysTillTraining
)```
(Edited)
• 75,144 Points
Alternatively

Max(0, WeekdaySub (ToDate([Training Start Date]), Today()))

If the calculated value is less than zero then the 0 will be the "Max"

same result as what Forrest posted.
• 300 Points
Apologies for the delay in responding - finally got around to applying the formula this morning and it works beautifully.

Can't thank you enough for the help as I go through and try to fine-tune the app, based on user responses/feedback.  You folks make me look like a hero to them and for that, I can't thank you enough.