I discovered today that Salesforce's MOD function (in formulae and workflows) will return a negative value if given a negative input.
MOD(-5, 12) = -5
This goes against the mathematical definition of Modulo, and makes it useless when dealing with dates.
The only way I can think of to handle this is:
MOD(MOD(Field__c, 12) + 12, 12)
But this doesn't seem like a sensible approach and will eat up compiled bytes rather quickly.
Is there a more sensible way to handle this?