I created the following base.
Let me know if it helps .
You can check formulas in the base.
Reference for date-time functions
For an overview of formula fields, please refer to the Guide to Formula, Lookup, Count, and Rollup fields.
Formulas may involve functions, numeric operations, logical operations, and text operation...