# How to If-then-else—\> array?

**URL:** <https://community.glideapps.com/t/how-to-if-then-else-array/13835>\
**Category:** Report a Bug\
**Created:** [August 11, 2020, 12:54am UTC](https://community.glideapps.com/t/how-to-if-then-else-array/13835 "2020-08-11T00:54:31Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [August 11, 2020, 1:13am UTC](https://community.glideapps.com/t/how-to-if-then-else-array/13835/4 "2020-08-11T01:13:36Z")

</div>

To fix your problem with the formula being deleted, you should actually make it part of your headings, or in my case I usually have 2 header rows. One with the heading and one with the formula. I have my formulas structured so nothing actually shows in the second row and Glide ignores it.

Here is some more info on structureing the header with the 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/1):
>
> _ **3.2. Keep the arrayformula in the headers** _
> 
> Instead of putting the arrayformula in row 2 where the data starts, you can put it in the header and never have to worry about accidentally delete that row ever again.
> 
> This formula below would create an array, populating the first cell with the header name, and the arrayformula starts from below that.
> 
> ```auto
> ={"Order value";ARRAYFORMULA(IF(A2:A<>"",A2:A*B2:B,""))}
> 
> ```

---

_[View the full topic](https://community.glideapps.com/t/how-to-if-then-else-array/13835)._
