# Shuffle images in row cells

**URL:** <https://community.glideapps.com/t/shuffle-images-in-row-cells/8214>\
**Category:** Ask for Help\
**Created:** [April 30, 2020, 2:58pm UTC](https://community.glideapps.com/t/shuffle-images-in-row-cells/8214 "2020-04-30T14:58:47Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![chethan\_M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/chethan_m/32/2155_2.png) [@chethan\_M](https://community.glideapps.com/u/chethan_M)\
**Post date:** [April 30, 2020, 2:58pm UTC](https://community.glideapps.com/t/shuffle-images-in-row-cells/8214/1 "2020-04-30T14:58:47Z")

</div>

Hi,

My app displays the photos of the users…acuser might upload 2 photo a user might upload 3 ( maximum is 5 photos)…the link of the photo is stored in column name image2,2,3,4,5 …  
My requirement is I want to shuffel images randomly so that a user sees different images daily in his profile …

How can I achieve it in Google sheet…

---

<div class="post-metadata">

**Author:** ![eltintero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eltintero/32/76520_2.png) [@eltintero](https://community.glideapps.com/u/eltintero)\
**Post date:** [April 30, 2020, 4:25pm UTC](https://community.glideapps.com/t/shuffle-images-in-row-cells/8214/2 "2020-04-30T16:25:59Z")

</div>

I think the only way is separating those images into different columns with a Google Script and then use the **Sort order** - **Random** for displaying the images

---

<div class="post-metadata">

**Author:** ![Drearystate](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drearystate/32/49605_2.png) [@Drearystate](https://community.glideapps.com/u/Drearystate)\
**Post date:** [April 30, 2020, 5:44pm UTC](https://community.glideapps.com/t/shuffle-images-in-row-cells/8214/3 "2020-04-30T17:44:39Z")

</div>

I agree, if you want just 1 random image shown per day, then have a column that just says =rand(a1,a2,a3)  
and it should randomize those images. The issue with this is that every time the page is updated the image will change. So it wont be a daily change. The way to fix that would be to have a cell populate the current date using the now() function and whenever the page is updated it checks to see if the date matches, if it doesnt it will randomize otherwise do nothing so lets say the random cell is a4, and cell a5 has todays date in it it would look something like this:

a4 would be =IF(A4=A5,"",NOW())  
And the cell that is randomizing would be: IF($A$4=$A$5,"",RAND(A1,A2,A3))

It would look something like that, and once you had the first formula made you could copy and past down the line just make sure you keep the $ so the cells don’t change when you copy and paste.

---

<div class="post-metadata">

**Author:** ![Drearystate](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drearystate/32/49605_2.png) [@Drearystate](https://community.glideapps.com/u/Drearystate)\
**Post date:** [April 30, 2020, 5:52pm UTC](https://community.glideapps.com/t/shuffle-images-in-row-cells/8214/4 "2020-04-30T17:52:13Z")

</div>

Also, this does create a circular reference so in google sheets go to file, spreadsheet settings, calculation tab and turn on iterative calculation leave the numbers at default or lower but do not increase the number of iterations or threshold and under recalculation change it to on change and every minute.

---

<div class="post-metadata">

**Author:** ![chethan\_M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/chethan_m/32/2155_2.png) [@chethan\_M](https://community.glideapps.com/u/chethan_M)\
**Post date:** [May 1, 2020, 2:49am UTC](https://community.glideapps.com/t/shuffle-images-in-row-cells/8214/5 "2020-05-01T02:49:35Z")

</div>

Thank you very much…will try this out…

---

<div class="post-metadata">

**Author:** ![chethan\_M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/chethan_m/32/2155_2.png) [@chethan\_M](https://community.glideapps.com/u/chethan_M)\
**Post date:** [May 2, 2020, 6:09am UTC](https://community.glideapps.com/t/shuffle-images-in-row-cells/8214/6 "2020-05-02T06:09:50Z")

</div>

The solution worked… thank you very much

---

<div class="post-metadata">

**Author:** ![Drearystate](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drearystate/32/49605_2.png) [@Drearystate](https://community.glideapps.com/u/Drearystate)\
**Post date:** [May 3, 2020, 11:22pm UTC](https://community.glideapps.com/t/shuffle-images-in-row-cells/8214/7 "2020-05-03T23:22:46Z")

</div>

which solution did you use if you dont mind me asking?

---

<div class="post-metadata">

**Author:** ![chethan\_M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/chethan_m/32/2155_2.png) [@chethan\_M](https://community.glideapps.com/u/chethan_M)\
**Post date:** [May 4, 2020, 3:18pm UTC](https://community.glideapps.com/t/shuffle-images-in-row-cells/8214/8 "2020-05-04T15:18:23Z")

</div>

I used IF($A$4=$A$5,"",RAND(A1,A2,A3)) Solution

---

<div class="post-metadata">

**Author:** ![Drearystate](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drearystate/32/49605_2.png) [@Drearystate](https://community.glideapps.com/u/Drearystate)\
**Post date:** [May 5, 2020, 2:13am UTC](https://community.glideapps.com/t/shuffle-images-in-row-cells/8214/9 "2020-05-05T02:13:52Z")

</div>

Nice 🙂 If you need any more help dont hesitate to ask.

---

<div class="post-metadata">

**Author:** ![chethan\_M](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/chethan_m/32/2155_2.png) [@chethan\_M](https://community.glideapps.com/u/chethan_M)\
**Post date:** [May 5, 2020, 7:11am UTC](https://community.glideapps.com/t/shuffle-images-in-row-cells/8214/10 "2020-05-05T07:11:01Z")

</div>

Definitely…thanks
