# Range returning more than one value per row on arrayformula

**URL:** <https://community.glideapps.com/t/range-returning-more-than-one-value-per-row-on-arrayformula/1068>\
**Category:** Ask for Help\
**Created:** [October 10, 2019, 1:07pm UTC](https://community.glideapps.com/t/range-returning-more-than-one-value-per-row-on-arrayformula/1068 "2019-10-10T13:07:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandro\_Brito](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sandro_brito/32/552_2.png) [@Sandro\_Brito](https://community.glideapps.com/u/Sandro_Brito)\
**Post date:** [October 10, 2019, 1:07pm UTC](https://community.glideapps.com/t/range-returning-more-than-one-value-per-row-on-arrayformula/1068/1 "2019-10-10T13:07:29Z")

</div>

Not sure if the title is right but I am having the following problem.

I am building a rock, paper, scissors game in it there are essentially challenges that have 2 states.  
Once created a challenge goes into the state of “waiting for player 2”  
Once player 2 plays, theres a state of “winner is this” or “tie”

This is my formula. The problem I am having is in concatenate.  
=Arrayformula(IF(LEN($A2:$A) = 0, “”,if(M2:M = “Finished”,if(D2:D=J2:J, “It’s a tie”, if(or(and(D2:D=“Rock”, J2:J=“Scissors”), and(D2:D=“Scissors”, J2:J=“Paper”), and(D3:D=“Paper”, J2:J=“Rock”)), “Player 1 won”, “Player 2 won”)),CONCATENATE(“Waiting for “,H2:H,” to play”)))  
)

CONCATENATE(“Waiting for “,H2:H,” to play”) is returning the name all of player 2 on the list rather than the one for that row only.  
I am not great with spreadsheets but all the others seem to be working in a “per row” basis.

Does anyone know why it isn’t working?

---

<div class="post-metadata">

**Author:** ![George\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george_b/32/534_2.png) [@George\_B](https://community.glideapps.com/u/George_B)\
**Post date:** [October 10, 2019, 1:32pm UTC](https://community.glideapps.com/t/range-returning-more-than-one-value-per-row-on-arrayformula/1068/2 "2019-10-10T13:32:55Z")

</div>

It’s hard see if what I’m thinking would work without the spreadsheet but…  
You have to get rid of the H2:H and replace it with something like this. I did not test this!

```auto
INDIRECT("H" & row())

```

---

<div class="post-metadata">

**Author:** ![Todd57](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/todd57/32/600_2.png) [@Todd57](https://community.glideapps.com/u/Todd57)\
**Post date:** [October 10, 2019, 2:04pm UTC](https://community.glideapps.com/t/range-returning-more-than-one-value-per-row-on-arrayformula/1068/3 "2019-10-10T14:04:52Z")

</div>

> [@Sandro\_Brito](#):
>
> CONCATENATE(“Waiting for “,H2:H,” to play”

Instead of using Concatenate, which doesn’t work with Arrayformula, you should make this part of the formula: `CONCATENATE(“Waiting for “,H2:H,” to play”` into this `"Waiting for " & H2:H & " to play"`

---

<div class="post-metadata">

**Author:** ![Sandro\_Brito](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sandro_brito/32/552_2.png) [@Sandro\_Brito](https://community.glideapps.com/u/Sandro_Brito)\
**Post date:** [October 10, 2019, 2:07pm UTC](https://community.glideapps.com/t/range-returning-more-than-one-value-per-row-on-arrayformula/1068/4 "2019-10-10T14:07:44Z")

</div>

Worked like a charm @Todd57. Thank you so much

---

<div class="post-metadata">

**Author:** ![Todd57](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/todd57/32/600_2.png) [@Todd57](https://community.glideapps.com/u/Todd57)\
**Post date:** [October 10, 2019, 2:11pm UTC](https://community.glideapps.com/t/range-returning-more-than-one-value-per-row-on-arrayformula/1068/5 "2019-10-10T14:11:24Z")

</div>

You’re very welcome. I ran into the same thing the other day when I was trying to create a column of concatenated values. Thankfully, the new Template column in Glide works a lot better for my needs. I found that I couldn’t use Arrayformula in sheets where new rows needed to be added from within Glide. If I added a new row, it would end up way down at the bottom past the first 1000 rows, and the Arrayformula wouldn’t perform its task on the new data.

---

<div class="post-metadata">

**Author:** ![Sandro\_Brito](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/sandro_brito/32/552_2.png) [@Sandro\_Brito](https://community.glideapps.com/u/Sandro_Brito)\
**Post date:** [October 10, 2019, 2:13pm UTC](https://community.glideapps.com/t/range-returning-more-than-one-value-per-row-on-arrayformula/1068/6 "2019-10-10T14:13:47Z")

</div>

I solved that by deleting all rows and making sure to add =if(len($A2:A = 0), “”, Place your formula here) @Todd57  
It seems to do the trick.

Still need to learn what the template column in glide does. Anywhere I can find documentation for this?

---

<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:** [October 10, 2019, 2:41pm UTC](https://community.glideapps.com/t/range-returning-more-than-one-value-per-row-on-arrayformula/1068/7 "2019-10-10T14:41:52Z")

</div>

@Todd57 Just a note when using array formulas, you have to delete all empty rows from your sheet. Array formulas should still function whenever Glide adds a new row to the sheet.

@Sandro_Brito

> <https://mobile.twitter.com/glideapps/status/1179877448248254464>

---

<div class="post-metadata">

**Author:** ![George\_B](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george_b/32/534_2.png) [@George\_B](https://community.glideapps.com/u/George_B)\
**Post date:** [October 10, 2019, 4:16pm UTC](https://community.glideapps.com/t/range-returning-more-than-one-value-per-row-on-arrayformula/1068/8 "2019-10-10T16:16:10Z")

</div>

> [@Jeff\_Hager](#):
>
> [mobile.twitter.com](https://mobile.twitter.com/glideapps/status/1179877448248254464)

This simplest of solutions is always the best. Nice one @Todd57!

---

<div class="post-metadata">

**Author:** ![Todd57](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/todd57/32/600_2.png) [@Todd57](https://community.glideapps.com/u/Todd57)\
**Post date:** [October 10, 2019, 4:54pm UTC](https://community.glideapps.com/t/range-returning-more-than-one-value-per-row-on-arrayformula/1068/9 "2019-10-10T16:54:55Z")

</div>

@Jeff_Hager & @Sandro_Brito, thank you both. I never even thought about doing that, and Glide is still relatively new to find that level of questioning via Google search. I’ll keep this in mind when I come across another instance where ArrayFormula is needed.

For now, the Template Column is serving my needs just fine. It was a great addition to Glide. However, if the Choice component gave us the ability to store a different value than what is displayed in the pick list, I may not have even needed the Template Column. I’m using the Template Column to generate a unique identifier for each row in my sheets (kind of like a composite key), which I use to populate the choice component in other forms.
