# Glide / Google Gods - Solve This Please

**URL:** <https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605>\
**Category:** Ask for Help\
**Created:** [December 9, 2020, 8:46am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605 "2020-12-09T08:46:27Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![V88](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v88/32/90054_2.png) [@V88](https://community.glideapps.com/u/V88)\
**Post date:** [December 9, 2020, 10:01am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/21 "2020-12-09T10:01:48Z")

</div>

Thanks @ThinhDinh. The sample from @MegannLock does calculate the minimum value across the set of columns. It also “replicates down” as new rows are added. It’s very smart. Thanks @MegannLock.

However I have three “reservations”. Firstly, whilst it very cleverly finds the min value it doesn’t identify the specific column holding that value. Secondly, I just don’t understand it, and I am always wary of introducing functionality into my apps that I don’t fully understand. Thirdly I would have loved to achieve this 100% in Glide.

So I guess I need to learn about Google Sheets QUERY to overcome two of these at least. Awesome community guys, yet again.

---

<div class="post-metadata">

**Author:** ![V88](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v88/32/90054_2.png) [@V88](https://community.glideapps.com/u/V88)\
**Post date:** [December 9, 2020, 10:02am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/22 "2020-12-09T10:02:47Z")

</div>

Hang on @Manan_Mehta…you’re telling me that the GDE supports MIN()?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 9, 2020, 10:02am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/23 "2020-12-09T10:02:50Z")

</div>

I haven’t achieved the column thing yet but here’s my attempt.

> **[Thinh Dinh's lab V2.0](https://docs.google.com/spreadsheets/d/1JzBrp4R1zK9CMfmTzWWcPPep9-ZCl3OXxgWu27NWCy8/edit#gid=1009544369)**
>
> Lowest Header
> 
> Column A,Column B,Column C,Column D,Column E,Column F,Column G,Column H,Lowest value,Lowest value column
> 5,7,9,1,3,4,2,6,1
> \-5,-4,-6,-99,88,77,33,22,-99
> 13,4,16,8,19,5,3,18,3

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 9, 2020, 10:03am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/24 "2020-12-09T10:03:02Z")

</div>

Yeah it does.

---

<div class="post-metadata">

**Author:** ![Manan\_Mehta](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manan_mehta/32/13957_2.png) [@Manan\_Mehta](https://community.glideapps.com/u/Manan_Mehta)\
**Post date:** [December 9, 2020, 10:04am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/25 "2020-12-09T10:04:07Z")

</div>

Yes it does!

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/5/f53e4be16430a71c39db8327acc5687497aa20a6.png)

---

<div class="post-metadata">

**Author:** ![V88](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v88/32/90054_2.png) [@V88](https://community.glideapps.com/u/V88)\
**Post date:** [December 9, 2020, 10:06am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/26 "2020-12-09T10:06:12Z")

</div>

Not sure whether to laugh or shoot myself …

---

<div class="post-metadata">

**Author:** ![V88](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v88/32/90054_2.png) [@V88](https://community.glideapps.com/u/V88)\
**Post date:** [December 9, 2020, 10:10am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/27 "2020-12-09T10:10:55Z")

</div>

Thanks so much @MegannLock, @ThinhDinh and @Manan_Mehta for the awesome responses. Armed with this combo I can move forward. Very much appreciated. Have good days all!

---

<div class="post-metadata">

**Author:** ![MegannLock](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/megannlock/32/19680_2.png) [@MegannLock](https://community.glideapps.com/u/MegannLock)\
**Post date:** [December 9, 2020, 10:29am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/28 "2020-12-09T10:29:33Z")

</div>

Same!! I didn’t realize that the data editor had MIN capability! 😱 my bad!

---

<div class="post-metadata">

**Author:** ![V88](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v88/32/90054_2.png) [@V88](https://community.glideapps.com/u/V88)\
**Post date:** [December 9, 2020, 10:38am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/29 "2020-12-09T10:38:08Z")

</div>

Argh … it DOES support MIN but only for TWO parameters …

So MIN(A,B) is fine but MIN(A,B,C) is not. Time to load the revolver again.

---

<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:** [December 9, 2020, 10:41am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/30 "2020-12-09T10:41:50Z")

</div>

I shouldn’t laugh, but… 🤣

Are you open to a script solution? 😁

---

<div class="post-metadata">

**Author:** ![MegannLock](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/megannlock/32/19680_2.png) [@MegannLock](https://community.glideapps.com/u/MegannLock)\
**Post date:** [December 9, 2020, 10:47am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/31 "2020-12-09T10:47:22Z")

</div>

So sorry! ☹ 😫  
 ![](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/b/7b16e0979d5ed22883665d18a53b8255efba73bd.gif)

---

<div class="post-metadata">

**Author:** ![V88](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v88/32/90054_2.png) [@V88](https://community.glideapps.com/u/V88)\
**Post date:** [December 9, 2020, 10:50am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/32 "2020-12-09T10:50:54Z")

</div>

Yes. At this point I’ll take anything. @MegannLock solution (and @ThinhDinh ) will work for sure. But certainly open to look at alternatives given it’s going to be Google-based anyway. Shoot (not me).

---

<div class="post-metadata">

**Author:** ![Manan\_Mehta](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manan_mehta/32/13957_2.png) [@Manan\_Mehta](https://community.glideapps.com/u/Manan_Mehta)\
**Post date:** [December 9, 2020, 10:59am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/33 "2020-12-09T10:59:56Z")

</div>

Oops. Well it can still be done in Glide. Use a nested Min function like this:  
Repeat Min 8 times in your case

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/1/11a1297a1c5c8c674499cab102b918e33d5a06ba.png)

---

<div class="post-metadata">

**Author:** ![V88](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v88/32/90054_2.png) [@V88](https://community.glideapps.com/u/V88)\
**Post date:** [December 9, 2020, 11:01am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/34 "2020-12-09T11:01:30Z")

</div>

What sort of coffee are you drinking @Manan_Mehta because I want some of that stuff. Heading back to the GDE as we speak…

---

<div class="post-metadata">

**Author:** ![Manan\_Mehta](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/manan_mehta/32/13957_2.png) [@Manan\_Mehta](https://community.glideapps.com/u/Manan_Mehta)\
**Post date:** [December 9, 2020, 11:06am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/35 "2020-12-09T11:06:33Z")

</div>

![Screenshot_20201209-163536_Instagram](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/5/753d54f9bbcff448fafef3c9460305408d71ec63.jpeg)

😆

---

<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:** [December 9, 2020, 11:10am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/36 "2020-12-09T11:10:50Z")

</div>

Here is a script solution:

> **Summary**
>
> ```
> function get_header_for_min() {
> var ss = SpreadsheetApp.getActiveSpreadsheet();
> var sheet = ss.getSheetByName('Sheet1');
> var row = 2;
> while (row <= sheet.getLastRow()) {
> var vals = sheet.getRange(row,2,1,9).getValues();
> var index = indexOfSmallest(vals[0]);
> var header = sheet.getRange(1,index+2).getValue();
> sheet.getRange(row,12).setValue(header);
> row++;
> }
> }
> 
> function indexOfSmallest(a) {
> var lowest = 0;
> for (var i = 1; i < a.length; i++) {
> if (a[i] < a[lowest]) lowest = i;
> }
> return lowest;
> }
> 
> ```

I added this script to @MegannLock’s [sheet](https://docs.google.com/spreadsheets/d/1HLN8fuTbyPzlg9sqqPBXPKr94MD8TP0r8_K5HM3CkJw/edit#gid=0), so you can play with it there if you want.

---

<div class="post-metadata">

**Author:** ![V88](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v88/32/90054_2.png) [@V88](https://community.glideapps.com/u/V88)\
**Post date:** [December 9, 2020, 11:11am UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/37 "2020-12-09T11:11:35Z")

</div>

Yup. It works @Manan_Mehta . Amazing stuff. Thanks again to all in the thread. And @Darren_Murphy I will play with the script too since it’s always good to learn.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 9, 2020, 12:11pm UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/38 "2020-12-09T12:11:21Z")

</div>

😂😂😂

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [December 9, 2020, 12:11pm UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/39 "2020-12-09T12:11:50Z")

</div>

This community is full of amazing people I must say.

---

<div class="post-metadata">

**Author:** ![V88](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/v88/32/90054_2.png) [@V88](https://community.glideapps.com/u/V88)\
**Post date:** [December 9, 2020, 12:13pm UTC](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605/40 "2020-12-09T12:13:42Z")

</div>

And some don’t even drink coffee apparently! Must be a modern thing.

[Previous page](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605.md?page=1)

[Next page](https://community.glideapps.com/t/glide-google-gods-solve-this-please/19605.md?page=3)
