# 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:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![S\_C](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/s_c/32/12766_2.png) [@S\_C](https://community.glideapps.com/u/S_C)\
**Post date:** [August 11, 2020, 12:54am UTC](https://community.glideapps.com/t/how-to-if-then-else-array/13835/1 "2020-08-11T00:54:31Z")

</div>

👋 everyone!

I need help. I am trying to convert multiple if-then-else to array(for example, pic 1, pic 2, pic 3-\> pic array). As if-then-else columns don’t sync back to Google Sheet, I am struggling.

Btw, shouldn’t ITE1, ITE2-\> ITE array?

Anyone who solves the problem gets a reward of 1 million thanks. 😊

---

<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:05am UTC](https://community.glideapps.com/t/how-to-if-then-else-array/13835/2 "2020-08-11T01:05:55Z")

</div>

You can’t create an array column with glide columns like you can with Google sheet columns. You would have to do your IF THEN statements in the Google sheet instead. Not sure why, but that’s been my experience.

---

<div class="post-metadata">

**Author:** ![S\_C](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/s_c/32/12766_2.png) [@S\_C](https://community.glideapps.com/u/S_C)\
**Post date:** [August 11, 2020, 1:08am UTC](https://community.glideapps.com/t/how-to-if-then-else-array/13835/3 "2020-08-11T01:08:31Z")

</div>

I agree. I did and the problem is when I deleted the top row those were all gone. Since syncing functions in google sheets are not optimal for Glide and glide users, I wanted to see if there is a native glide solution?

---

<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,""))}
> 
> ```

---

<div class="post-metadata">

**Author:** ![S\_C](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/s_c/32/12766_2.png) [@S\_C](https://community.glideapps.com/u/S_C)\
**Post date:** [August 11, 2020, 1:26am UTC](https://community.glideapps.com/t/how-to-if-then-else-array/13835/5 "2020-08-11T01:26:47Z")

</div>

Thanks @Jeff_Hager! Very helpful. Can you think of some way to help me with glide native solution as well. I know you can! I tried for 3 hours and didn’t get anywhere.

Here is the problem rephrased:

There are text only columns which contain target text. I need glide to identify one part per column and these columns should make an array so that I can create and inline list.  
Previously, I had created Boolean columns in sheets that I would manually ‘switch on’/ mark ‘TRUE’ so that another column in an array would write the keyword leading to a relation and thus leading to an inline list in glide. I am trying to avoid the manual ‘switch on’ using sheets.

If you can’t think of a solution, I understand and thank you for thinking.

If I am not clear in explaining the problem, please let me know.

---

<div class="post-metadata">

**Author:** ![Coupons\_Deal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/coupons_deal/32/9734_2.png) [@Coupons\_Deal](https://community.glideapps.com/u/Coupons_Deal)\
**Post date:** [August 11, 2020, 5:52am UTC](https://community.glideapps.com/t/how-to-if-then-else-array/13835/6 "2020-08-11T05:52:31Z")

</div>

@S_C What is your business case or purpose for this?  
Not a solution but you can create equivalent template/relation-lookup… column to sync back your data to googlesheet. Haven’t tried just a vague imagination.

---

<div class="post-metadata">

**Author:** ![Coupons\_Deal](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/coupons_deal/32/9734_2.png) [@Coupons\_Deal](https://community.glideapps.com/u/Coupons_Deal)\
**Post date:** [August 11, 2020, 5:56am UTC](https://community.glideapps.com/t/how-to-if-then-else-array/13835/7 "2020-08-11T05:56:34Z")

</div>

Can you quote with example/demo? Not entirely clear for me.

---

<div class="post-metadata">

**Author:** ![S\_C](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/s_c/32/12766_2.png) [@S\_C](https://community.glideapps.com/u/S_C)\
**Post date:** [August 11, 2020, 7:43am UTC](https://community.glideapps.com/t/how-to-if-then-else-array/13835/8 "2020-08-11T07:43:20Z")

</div>

Tried lookup, join, and template. None of these sync back to google sheets 🙁

---

<div class="post-metadata">

**Author:** ![S\_C](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/s_c/32/12766_2.png) [@S\_C](https://community.glideapps.com/u/S_C)\
**Post date:** [August 11, 2020, 7:46am UTC](https://community.glideapps.com/t/how-to-if-then-else-array/13835/9 "2020-08-11T07:46:10Z")

</div>

Let me elaborate the case scenario in the morning as it’s a bit complicated to write at 3 am 😅. Btw, thanks for helping me.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [February 7, 2024, 2:56am UTC](https://community.glideapps.com/t/how-to-if-then-else-array/13835/10 "2024-02-07T02:56:49Z")

</div>


