How can I put a result in a calculation depending on a certain date?