# If then else with DATE

**URL:** <https://community.glideapps.com/t/if-then-else-with-date/11328>\
**Category:** Ask for Help\
**Created:** [June 23, 2020, 3:02pm UTC](https://community.glideapps.com/t/if-then-else-with-date/11328 "2020-06-23T15:02:14Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [April 3, 2022, 6:38am UTC](https://community.glideapps.com/t/if-then-else-with-date/11328/18 "2022-04-03T06:38:38Z")

</div>

@Food2Soil - here, I think this is a better approach…

> **[Dynamic Month by Month Table](https://www.loom.com/share/5c4b22458b2d48bc94d88607b4026c05)**

The math formulas used:

- To add an arbitrary number of months to a date:

```auto
((Now-DAY(Now)+15)+(Years/12*365.25))
-
DAY((Now-DAY(Now)+15)+(Years/12*365.25))
+
DAY(Now)

```

- To get midnight on the first day of the month from a given date:

```auto
Date+1-Day(Date)-Hour(Date)/24-Minute(Date)/1440-Second(Date)/86400

```

---

_[View the full topic](https://community.glideapps.com/t/if-then-else-with-date/11328)._
