# Google Sheets Formula Question

**URL:** <https://community.glideapps.com/t/google-sheets-formula-question/10544>\
**Category:** Ask for Help\
**Created:** [June 8, 2020, 7:40pm UTC](https://community.glideapps.com/t/google-sheets-formula-question/10544 "2020-06-08T19:40:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevyn\_Levine](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kevyn_levine/32/7902_2.png) [@Kevyn\_Levine](https://community.glideapps.com/u/Kevyn_Levine)\
**Post date:** [June 8, 2020, 7:40pm UTC](https://community.glideapps.com/t/google-sheets-formula-question/10544/1 "2020-06-08T19:40:42Z")

</div>

Hello! Me again, with another silly question…

I need a formula to calculate difference between 2 dates but if i put in the formula and drag it all the way down to infinity, it will use my 500/500 rows, i want the formula to trigger only when data exists, as in some sort of conditional format to only activate the formula when data in the row exists - is there a work around other than just an =IF formula?

I swear I looked…

---

<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:** [June 8, 2020, 7:48pm UTC](https://community.glideapps.com/t/google-sheets-formula-question/10544/2 "2020-06-08T19:48:12Z")

</div>

First of all, dragging down will not work since Glide will add any new rows after the last row with a formula. An arrayformulas would be much better as it grows with your data. Also using an arrayformula, it will be best to delete all empty rows. For Glide to not recognize a row as filled, you need to set up your formula with an IF to check if another field is filled in the row. If the other field is empty, the formula will return empty and be ignored by Glide.

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

> **[Glide Docs](https://www.glideapps.com/docs)**
>
> Welcome to Glide Docs, a steadily growing collection of articles and videos on how to use Glide. We can’t wait to see what you build!
