# Help colum math

**URL:** <https://community.glideapps.com/t/help-colum-math/41666>\
**Category:** Ask for Help\
**Created:** [May 5, 2022, 6:04pm UTC](https://community.glideapps.com/t/help-colum-math/41666 "2022-05-05T18:04:39Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Master01](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/master01/32/37550_2.png) [@Master01](https://community.glideapps.com/u/Master01)\
**Post date:** [May 5, 2022, 6:04pm UTC](https://community.glideapps.com/t/help-colum-math/41666/1 "2022-05-05T18:04:40Z")

</div>

How can I add months, for example if today is May 5th and I add 2 months to it, let it be July 5th, would someone be so kind as to indicate a solution in glidetable, I do not want it in google sheet

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [May 5, 2022, 6:14pm UTC](https://community.glideapps.com/t/help-colum-math/41666/2 "2022-05-05T18:14:37Z")

</div>

This one is tricky. I have a couple solutions but I want to make sure I’m solving the correct problem. Why are you adding two months to a date?

- Just for display purposes?
- or for calculation purposes?

---

<div class="post-metadata">

**Author:** ![Master01](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/master01/32/37550_2.png) [@Master01](https://community.glideapps.com/u/Master01)\
**Post date:** [May 5, 2022, 6:39pm UTC](https://community.glideapps.com/t/help-colum-math/41666/3 "2022-05-05T18:39:36Z")

</div>

To calculate that if a person registers and indicates that they will be connected for 2 months, I have to add those 2 months to the current date of registration

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [May 5, 2022, 8:16pm UTC](https://community.glideapps.com/t/help-colum-math/41666/4 "2022-05-05T20:16:22Z")

</div>

So you need it for calculation purposes, correct? You’re trying to check to see if today’s day is or is after the month+2 date so you can restrict/hide items in the app?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [May 5, 2022, 10:03pm UTC](https://community.glideapps.com/t/help-colum-math/41666/5 "2022-05-05T22:03:09Z")

</div>

This is the latest version of my math formula to add months to a date. It will add the specified number of months, but if the calculated date does not contain the same day number, it will back date to the last day of the goal month. (ex. adding 1 month to Jan 31st will calculate to Feb 28th instead of Mar 3rd). I don’t know if this is exactly what you want. You would have to tell us what should happen if the month you calculate 2 months from now doesn’t contain the same day number as the start date.

> [@If then else with DATE](https://community.glideapps.com/t/if-then-else-with-date/11328/23):
>
> @Darren_Murphy @Milan_Balogh Geez, I had to put on my thinking cap before my morning coffee. The same place that Darren got that original formula had a second formula. It looks like that old thread is unlisted now, so I won’t link to it, but the second formula dealt with adding years, and also accounted for leap year, so if you added 1 year to Feb 29th, then the next year if would calculated to Feb 28th instead of March 1st. Essentially it would figure out if the month of the future calculate…

---

<div class="post-metadata">

**Author:** ![Master01](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/master01/32/37550_2.png) [@Master01](https://community.glideapps.com/u/Master01)\
**Post date:** [May 5, 2022, 10:24pm UTC](https://community.glideapps.com/t/help-colum-math/41666/6 "2022-05-05T22:24:15Z")

</div>

Exactly, something like this is what I’m looking for if today is 5/5/2022 and I add 2 months so the month contains 28 or 30 or 31 days I want 7/5/2022 to come out I don’t know if I’m letting myself be understood

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [May 5, 2022, 10:49pm UTC](https://community.glideapps.com/t/help-colum-math/41666/7 "2022-05-05T22:49:18Z")

</div>

Every month has a day number of 5. Not every month will have a day number of 29, 30, or 31. Those are the situations you need to consider. What do you expect if you add 2 months to December 31st?

---

<div class="post-metadata">

**Author:** ![Master01](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/master01/32/37550_2.png) [@Master01](https://community.glideapps.com/u/Master01)\
**Post date:** [May 5, 2022, 10:59pm UTC](https://community.glideapps.com/t/help-colum-math/41666/8 "2022-05-05T22:59:57Z")

</div>

What I expect in this situation is that you give me the date 28/02 day 28 month 02

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [May 5, 2022, 11:17pm UTC](https://community.glideapps.com/t/help-colum-math/41666/9 "2022-05-05T23:17:19Z")

</div>

Perfect. Then yes, the math formula in the post that I shared above will work for this. I’ll repost the formula here.

```auto
((Date-DAY(Date)+15)+TRUNC(Months/12*365.25))
-
DAY((Date-DAY(Date)+15)+TRUNC(Months/12*365.25))
+
DAY(Date)
-
MOD(
(DAY(((Date-DAY(Date)+15)+TRUNC(Months/12*365.25))
-
DAY((Date-DAY(Date)+15)+TRUNC(Months/12*365.25))
+
DAY(Date))-DAY(Date))
,DAY(Date))

```

---

<div class="post-metadata">

**Author:** ![Master01](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/master01/32/37550_2.png) [@Master01](https://community.glideapps.com/u/Master01)\
**Post date:** [May 7, 2022, 6:25pm UTC](https://community.glideapps.com/t/help-colum-math/41666/10 "2022-05-07T18:25:13Z")

</div>

Good morning, excellent formula one last query what parameters do I change if I want to add days, months and years

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [May 7, 2022, 8:22pm UTC](https://community.glideapps.com/t/help-colum-math/41666/11 "2022-05-07T20:22:13Z")

</div>

Days is easy, since all date math in glide is in days. To add days to a date, it’s as simple as adding the number of days you want to any date. You don’t need a complicated formula for that.

If you want to add years, then anywhere you see `Months/12` (which calculates the decimal form of years), you should be able to simply replace it with `Years`. Or you can just do the math to figure out how many month are in a year. 12 months in 1 year, 24 months in 2 years, etc.
