# Add new row is clearing my Google Sheet formula

**URL:** <https://community.glideapps.com/t/add-new-row-is-clearing-my-google-sheet-formula/31312>\
**Category:** Ask for Help\
**Created:** [September 3, 2021, 11:20am UTC](https://community.glideapps.com/t/add-new-row-is-clearing-my-google-sheet-formula/31312 "2021-09-03T11:20:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jordan\_Potts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jordan_potts/32/21359_2.png) [@Jordan\_Potts](https://community.glideapps.com/u/Jordan_Potts)\
**Post date:** [September 3, 2021, 11:20am UTC](https://community.glideapps.com/t/add-new-row-is-clearing-my-google-sheet-formula/31312/1 "2021-09-03T11:20:35Z")

</div>

Adding a new row from Glide into my sheet is clearing the google sheet formula that I have pre-inputted into the row, is there a way around this?

---

<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:** [September 3, 2021, 11:22am UTC](https://community.glideapps.com/t/add-new-row-is-clearing-my-google-sheet-formula/31312/2 "2021-09-03T11:22:31Z")

</div>

Do you use an arrayformula and you’re writing to that same column?

---

<div class="post-metadata">

**Author:** ![SantiagoPerez](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/santiagoperez/32/16807_2.png) [@SantiagoPerez](https://community.glideapps.com/u/SantiagoPerez)\
**Post date:** [September 3, 2021, 11:24am UTC](https://community.glideapps.com/t/add-new-row-is-clearing-my-google-sheet-formula/31312/3 "2021-09-03T11:24:46Z")

</div>

Hola @Jordan_Potts

Are you using an Array formula?

> [@Tutorial: Arrayformula in Google Sheets, good practices & how to overcome Arrayformula restrictions with scripts](https://community.glideapps.com/t/tutorial-arrayformula-in-google-sheets-good-practices-how-to-overcome-arrayformula-restrictions-with-scripts/9727):
>
> Hi, Today I will show you the script that can make copying formulas down work, when it does not work with arrayformula. But first, let’s have some introductions about arrayformula, for those who has not used this before in Google Sheets, some equivalents in Glide and some good practices while using it. I hope it can help you in building your Glide apps as well as applying it in your normal day job. 
> 
> > **1/ Definition**
> >
> > Arrayformula is defined as “a range, mathematical expression using one cell range …

Also, do you really need that formula en your Gsheets? Can it be done on the math column?  
What is that formula doing?

---

<div class="post-metadata">

**Author:** ![Jordan\_Potts](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jordan_potts/32/21359_2.png) [@Jordan\_Potts](https://community.glideapps.com/u/Jordan_Potts)\
**Post date:** [September 3, 2021, 11:29am UTC](https://community.glideapps.com/t/add-new-row-is-clearing-my-google-sheet-formula/31312/4 "2021-09-03T11:29:15Z")

</div>

The formula i’m using is:  
=IF(OR(ISBLANK(E2),TRUNC((F2-E2)/7)\>6000),TRUNC((F2-E2)/7))  
I did try using the Math column in glide but I think this is too complex for that  
I am not using ArrayFormula

---

<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:** [September 3, 2021, 11:33am UTC](https://community.glideapps.com/t/add-new-row-is-clearing-my-google-sheet-formula/31312/5 "2021-09-03T11:33:41Z")

</div>

What’s the wrong value in your formula?

I understand that if column E is blanc or TRUNC((F2-E2)/7) \> 6000 then return TRUNC(F2-E2)/7.

What if none of these conditions is true?

---

<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:** [September 3, 2021, 12:12pm UTC](https://community.glideapps.com/t/add-new-row-is-clearing-my-google-sheet-formula/31312/6 "2021-09-03T12:12:10Z")

</div>

That seems like a really simple formula. All you need is to put `TRUNC((F-E)/7)` in a math column and point F and E to the correct columns. Then create an IF Column to compare that math value to 6000 and return whatever you need.
