NetWorkingDays formula output changed?

We noticed an apparent change of behavior in the NetWorkingDays formula. It appears to now return negative numbers if the start date (first parameter) is later than the end date (second parameter).

This is fine in theory but I’m a bit alarmed if behavior like this changes without a way to be notified or review the changes. We can’t be sure that it changed without being able to test against a previous version of Coda.

Can someone from Coda confirm this?

Thank you

1 Like

Hi @Ed_Liveikis,

Apologies for the unexpected changes in NetWorkingDays formula. I was the engineer behind the change; we made it recently to improve the working of this method. It’s a breaking change and I reached out to some customers who used it in non-trivial ways (e.g. as part of a bigger formula). I’m sorry that I missed you during this process.

It’s considered a change on the smaller size and will be bundled with a few other changes and announced to the Community later. Here is the blurb for it and how to work around the change if you prefer the old behavior:

We’re making an improvement to the NetWorkingDays formula, so you no longer need to manually add logic to return a negative result when the start date is later than the end date. Currently, the formula returns a positive result regardless of the start & end date, but that doesn’t reflect that a date has already passed a milestone. If you wrote custom logic to flip the result when necessary, you can remove that logic.

If you want to preserve the old behavior, you can use the AbsoluteValue formula to make the formula returns positive result: Coda | Formula library

4 Likes

Hi Harry, thanks for the reply! Well that explains it, thanks. As I mentioned I didn’t have a way to confirm the change so it’s good to know.

I don’t suppose there is a way to search for all instances of a formula being used in a doc…but hopefully we don’t have other cases of the start/end needing to be flipped.