# Glide Editor screen goes blank when using Math Column

**URL:** https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646
**Category:** Report a Bug
**Created:** [December 10, 2020, 5:54am UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646 "2020-12-10T05:54:24Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)
#### Post date: [December 10, 2020, 5:54am UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/1 "2020-12-10T05:54:24Z")

</div>

I am trying to add Math Column for date calculation but as soon as select the columns, the screen goes blank. This happened with me four times. Am I doing something wrong?

---

<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: [December 10, 2020, 1:36pm UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/2 "2020-12-10T13:36:02Z")

</div>

Most likely a bug, but the bug is probably being caused because once you select a date, it’s immediately trying to add a Date to Row ID, which isn’t possible. The symbols in Row ID may be causing issues with the math to. Do you have issues if you first change the replacement for ‘D’ to something other than Row ID? Then change the replacement for ‘S’ afterwards.

---

<div class="post-metadata">

### Author: ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)
#### Post date: [December 10, 2020, 1:52pm UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/3 "2020-12-10T13:52:48Z")

</div>

Thanks @Jeff_Hager I will try that.

---

<div class="post-metadata">

### Author: ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)
#### Post date: [December 10, 2020, 2:11pm UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/4 "2020-12-10T14:11:50Z")

</div>

Jeff, you were correct. When I change Row ID, it works well. Thank you for this.

---

<div class="post-metadata">

### Author: ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)
#### Post date: [December 10, 2020, 2:30pm UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/5 "2020-12-10T14:30:10Z")

</div>

@Jeff_Hager Jeff, I need your help further for calculation.

I have Start Date, and I have number of years, I need to add Number of Years to the Start Date.  
For Example, if Start Date is 10th December, 2020 and Number of year is 2 Years, then End Date should exactly be 10th December, 2022. So the date remains same but the year changes.

Any idea how can I achieve this?

I tried to add days, but it does not achieve for all rows because of leap year.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/a/1a21893d45d281e1cee83fc8e08148fb7d8e2ff4.png)

---

<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: [December 10, 2020, 5:05pm UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/6 "2020-12-10T17:05:38Z")

</div>

In your math column, my first thought would be to try taking the date plus number of years multiplied by 365.25. So something like this `S+(D*365.25)`. But that probably wouldn’t be entirely accurate. It would probably work if the start date was a leap year and the time was always midnight, but not for other years.

Since Glide only handles date math in days, we would probably need them to add functionality to add months or years as well. Google sheets has an EDATE function which let’s you add a duration in months, so to add a year, you would add 12 months. Would you be opposed to a google sheet formula, or would that cause too much lag in your app? I’m sure we could figure it out with a more complicated math formula and possibly a seed date of a know leap year, but I’d have to take some time to experiment with that.

---

<div class="post-metadata">

### Author: ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)
#### Post date: [December 11, 2020, 6:50am UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/7 "2020-12-11T06:50:14Z")

</div>

Thank you Jeff for detailed explanation.  
I guess I will have to shift to Google Sheet formula for that. I will see if that has some lag or not.

I will revert to you

---

<div class="post-metadata">

### Author: ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)
#### Post date: [January 22, 2021, 3:17pm UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/8 "2021-01-22T15:17:38Z")

</div>

> [@Jeff\_Hager](#):
>
> m sure we could figure it out with a more complicated math formula and possibly a seed date of a know leap year, but I’d have to take some time to experiment with that.

Hi @Jeff_Hager Hope you are doing well.

Did you manage to get any math formula which can be used in Glide? As of now, as you suggested, I am using EDATE in Google Sheet, which is creating lag of 2-3 seconds (which is fine as of now).

---

<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: [January 22, 2021, 3:51pm UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/9 "2021-01-22T15:51:49Z")

</div>

I think I have some new ideas. What’s the max number of years you would most likely be adding? I think I can make something work if it’s not more that 50 or 75 years.

---

<div class="post-metadata">

### Author: ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)
#### Post date: [January 22, 2021, 3:53pm UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/10 "2021-01-22T15:53:09Z")

</div>

Thank you for response.  
I am only looking for 1 Year, 2 Years and 3 Years. Not more than that.

---

<div class="post-metadata">

### Author: ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)
#### Post date: [January 22, 2021, 3:55pm UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/11 "2021-01-22T15:55:20Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/8/48eb98c015aa8b032421c2b76dcba065a3b98d1d.png)  
This is the my Form wherein I am using it.

I want Expiry date should be automatically calculated based on Start date and Validity.

---

<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: [January 22, 2021, 3:57pm UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/12 "2021-01-22T15:57:28Z")

</div>

OK, I need to get back to work at my paying job, so I’ll come back to this a little later.

Meanwhile, for inspiration:

> [@Find the last day of the following month](https://community.glideapps.com/t/find-the-last-day-of-the-following-month/21557):
>
> I was wondering if it is possible, directly in Glide (without using sheet), to calculate the last calendar day of the month following the current one. For example: today is January 22, the date I need is February 28, 2021. This is useful for some payment installments in commercial contracts. Thanks

One more question, what would you expect for a result if the date was a leap year Feb 29th?

---

<div class="post-metadata">

### Author: ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)
#### Post date: [January 22, 2021, 4:00pm UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/13 "2021-01-22T16:00:27Z")

</div>

Thank you.  
If the Start date is 29th Feb, then the end date would be the last date of Feb of that particular year (i.e. 28th Feb) considering adding 2 year or 3 years.

---

<div class="post-metadata">

### Author: ![Roldy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/roldy/32/36068_2.png) [@Roldy](https://community.glideapps.com/u/Roldy)
#### Post date: [January 22, 2021, 4:06pm UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/14 "2021-01-22T16:06:12Z")

</div>

> [@Jeff\_Hager](#):
>
> One more question, what would you expect for a result if the date was a leap year Feb 29th?

I would expect March 31st, and your function is fine here too.

---

<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: [January 23, 2021, 12:20am UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/15 "2021-01-23T00:20:56Z")

</div>

**Edit:** I have some updates to this formula that I’ve explained in the post below.

> [@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…

You’re requirement to back Feb 29th by a day if it’s not a leap year does complicate it a bit, but that’s not a problem. It just makes for a formula that’s much larger.

Here is the formula if we were to allow Feb 29th to roll over to Mar 1st.

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

```

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/0/e0e0f7da5c4028e0f06234e4f8459b6de60d00ae.png)

‎  
‎  
‎  
‎  
‎  
To get the leap year date of Feb 29th to back date to Feb 28th instead of Mar 1st, then we need to duplicate a lot of the formula and calculate the month offset to subtract the number of months different as days. So the difference of the current month of February (2), is subtracted from the calculated date of March (3), and the difference (1) is subtracted as a day which rolls March 1st to February 28th.

```auto
((Now-DAY(Now)+15)+(Years*365.25))
-
DAY((Now-DAY(Now)+15)+(Years*365.25))
+
DAY(Now)
-
(MONTH(((Now-DAY(Now)+15)+(Years*365.25))
-
DAY((Now-DAY(Now)+15)+(Years*365.25))
+
DAY(Now))-MONTH(NOW))

```

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/0/f0f37ac21fd14363d1aebeaf32d3e21050b550c4.png)

‎  
‎  
‎  
‎  
‎  
I feel pretty comfortable that this will work with virtually an unlimited number of years since we are still accounting for leap years by multiplying by 365.25 instead of just 365.

---

<div class="post-metadata">

### Author: ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)
#### Post date: [January 23, 2021, 12:40am UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/16 "2021-01-23T00:40:21Z")

</div>

The 15 magic number!

---

<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: [January 23, 2021, 12:58am UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/17 "2021-01-23T00:58:01Z")

</div>

It’s the save your butt number! 😉

I thought it was going to bite me here and I would have maybe needed to change it to 28 or something like that. At first I used 365 instead of 365.25, so every 4 years the days would drift and the formula only worked to add up to 55 or 56 years before the days no longer lined up. Originally planned to make it 28, so we could add up to 75 or 100 years, but with the .25 it seems to allow for adding hundreds of years without any issues.

---

<div class="post-metadata">

### Author: ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)
#### Post date: [January 25, 2021, 5:08am UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/18 "2021-01-25T05:08:53Z")

</div>

Thank you @Jeff_Hager for this. I will check and revert.

---

<div class="post-metadata">

### Author: ![Pratik\_Shah](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/pratik_shah/32/12416_2.png) [@Pratik\_Shah](https://community.glideapps.com/u/Pratik_Shah)
#### Post date: [November 8, 2021, 5:19am UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/19 "2021-11-08T05:19:12Z")

</div>

> [@Pratik\_Shah](#):
>
> As of now, as you suggested, I am using EDATE in Google Sheet, which is creating lag of 2-3 seconds (which is fine as of now).

Hi @Jeff_Hager, hope you are well.

Since we have plug-in to use (Thanks to Glide Team), I want to use EDATE formula from Google Sheet to Glide Table.

I am trying to set it up here but not working. Am I doing it wrong?  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/0/30d41b28fea63f00445e5e6189daaff3a8a808a7.png)  
or

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/c/dc5b8a1a627c29e6e483ed6f78557a2adc562881.png)

---

<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: [November 9, 2021, 4:49am UTC](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646/20 "2021-11-09T04:49:45Z")

</div>

I’m not sure why it doesn’t work. I tried a few different things but didn’t have any luck. I’m guessing it’s not liking something with the way that the date is being formatted. The only way I could think of to make it work is to parse apart the date into separate year, month, and day columns, then put it back together in a template column to pass into the formula, but I’m not sure that will even work. The only way I could get the EDATE formula to return anything was to manually enter a date instead of an A1 parameter. Even then it gave me the date in serial number format, which isn’t what you would want, so you would then have to add more to the formula to get a valid date.

This is the only thing that remotely worked. Even then it seemed to recognize my date in the DD/MM/YY format instead of the MM/DD/YY format that I’m used to:  
`=TEXT(EDATE(DATEVALUE("08/11/21"),A2),"DD/MM/YYYY")`  
This returned `08/04/2022` when I passed in 5 as the number of months into A2.

If it were me, I’d probably stick with one of the math formulas I provided above, since I know they work pretty well and use native glide functions.

[Next page](https://community.glideapps.com/t/glide-editor-screen-goes-blank-when-using-math-column/19646.md?page=2)
