How to write a formula to work out due date basing on a reference date