# Rollup...by rank?

**URL:** <https://community.glideapps.com/t/rollup-by-rank/4551>\
**Category:** Feature Requests\
**Created:** [February 13, 2020, 4:47am UTC](https://community.glideapps.com/t/rollup-by-rank/4551 "2020-02-13T04:47:31Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [February 13, 2020, 4:47am UTC](https://community.glideapps.com/t/rollup-by-rank/4551/1 "2020-02-13T04:47:32Z")

</div>

Is there anyway to get the sort order of a list based on value to the maximum? With rollup, I can get the max, avg and min, but I’d love to get the RANK of a list based on these values. Sure, I can sort by the value in an inline list, but i wanted to retrieve the ordinal number of each row in this sorted list. I could always use a spreadsheet formula, but was hoping to avoid it.

---

<div class="post-metadata">

**Author:** ![Mark](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark/32/125_2.png) [@Mark](https://community.glideapps.com/u/Mark)\
**Post date:** [February 13, 2020, 5:12am UTC](https://community.glideapps.com/t/rollup-by-rank/4551/2 "2020-02-13T05:12:48Z")

</div>

Could you describe your use case, please?

---

<div class="post-metadata">

**Author:** ![spencersRus](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/spencersrus/32/69_2.png) [@spencersRus](https://community.glideapps.com/u/spencersRus)\
**Post date:** [February 13, 2020, 1:02pm UTC](https://community.glideapps.com/t/rollup-by-rank/4551/3 "2020-02-13T13:02:10Z")

</div>

Why do I think that this sentence will be in A LOT of @Robert_Petitto’s posts from now on?? 🙂

> [@Robert\_Petitto](#):
>
> I could always use a spreadsheet formula, but was hoping to avoid it.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [February 13, 2020, 1:28pm UTC](https://community.glideapps.com/t/rollup-by-rank/4551/4 "2020-02-13T13:28:02Z")

</div>

For leaderboards, I’d like to generate the ranking of users instantly. This is important when it comes to the aesthetics of the tab as I’d use a series of filters to make those ranked 1-3 more pronounced (larger tiles) than those ranked 5-\_\_. Here’s a mockup:

 ![Screen Shot 2020-02-13 at 8.27.52 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/4/48ac2c3edd0ae494a3a97602af35979875afe2ec.png)

---

<div class="post-metadata">

**Author:** ![Mark](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark/32/125_2.png) [@Mark](https://community.glideapps.com/u/Mark)\
**Post date:** [February 13, 2020, 2:06pm UTC](https://community.glideapps.com/t/rollup-by-rank/4551/5 "2020-02-13T14:06:27Z")

</div>

Ah, that’s an interesting use case!

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [February 13, 2020, 2:08pm UTC](https://community.glideapps.com/t/rollup-by-rank/4551/6 "2020-02-13T14:08:01Z")

</div>

Thanks. I’d also like to apply the rank number to the labels of the components as well.

---

<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:** [February 19, 2020, 4:23am UTC](https://community.glideapps.com/t/rollup-by-rank/4551/7 "2020-02-19T04:23:49Z")

</div>

This is the closest I could get on this one. I have 20 items and I do get a rank from 1 to 20, but it includes decimals, so it’s still not quite right. I imagine there is some kind of math formula to figure this out, but I’m not that smart. However, writing code, I could figure this out in a matter of minutes.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/1/1ef9abb51db3cca8d539b3b95c0c8a825cfc98b7.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/2X/2/26d872878f0224a8aae0d9501d4d1d1e987e5fb0.png)

Info on the formula:  
[http://mathforum.org/library/drmath/view/60433.html](http://mathforum.org/library/drmath/view/60433.html)

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [February 19, 2020, 11:31am UTC](https://community.glideapps.com/t/rollup-by-rank/4551/8 "2020-02-19T11:31:07Z")

</div>

Wow. Closer than I got! I was just going to do a spreadsheet formula and call it a day! 👏

---

<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:** [February 19, 2020, 12:42pm UTC](https://community.glideapps.com/t/rollup-by-rank/4551/9 "2020-02-19T12:42:26Z")

</div>

Hehe, yeah, that’s probably the best option for now.

---

<div class="post-metadata">

**Author:** ![Kudzai\_Tunduwani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kudzai_tunduwani/32/11838_2.png) [@Kudzai\_Tunduwani](https://community.glideapps.com/u/Kudzai_Tunduwani)\
**Post date:** [August 11, 2020, 12:54am UTC](https://community.glideapps.com/t/rollup-by-rank/4551/10 "2020-08-11T00:54:35Z")

</div>

Hey guys, I was able to figure out dynamic ranking, where as soon as a user’s x value changes, their rank among other users changes instantly as well.  
All I did was use a rank formula (rank(x,y:y)) in my spreadsheet, then I used a relation, then a lookup, to pull in the rank. No formulas required.

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [August 11, 2020, 2:06am UTC](https://community.glideapps.com/t/rollup-by-rank/4551/11 "2020-08-11T02:06:13Z")

</div>

Right. I was hoping to avoid formulas due to the lag.

---

<div class="post-metadata">

**Author:** ![Kudzai\_Tunduwani](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kudzai_tunduwani/32/11838_2.png) [@Kudzai\_Tunduwani](https://community.glideapps.com/u/Kudzai_Tunduwani)\
**Post date:** [August 11, 2020, 2:39am UTC](https://community.glideapps.com/t/rollup-by-rank/4551/12 "2020-08-11T02:39:55Z")

</div>

Ah. Gotcha. I haven’t noticed any significant lag so far. Maybe 3 seconds to update.

---

<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:** [February 10, 2021, 2:10pm UTC](https://community.glideapps.com/t/rollup-by-rank/4551/13 "2021-02-10T14:10:16Z")

</div>

I’d like to bump this feature request.

I think we need a Rank/Order functionality to sequentially number rows, either:

- Along the entire contents of a sheet.
- Or by specifying a grouping value, so each group has its own unique numbering.

Then within that sheet or grouping, I’d like to specify a column to rank by, either:

- Numerically
- Alphabetically
- Date Order
- Etc.

Then finally the ability to choose to number in:

- Ascending order
- Descending order

I was thinking of ways to build this into an existing column type, such as rollup, math, or single value, but maybe it would be better as its own column type. What I’m thinking is a Rank column with 3 setting options.

- The first setting option is to select the entire sheet, or select a specific column to group by.
- The second setting option is the actual value you want to rank by (such as a score or a date), or you can choose to select nothing and it will number by sheet order.
- The third option would be Ascending/Descending order so it numbers from top-down or bottom-up if nothing selected for option 2, or it numbers from lowest-greatest or greatest-lowest if you selected a value to rank by in option 2.

I’ve beat my head against the wall trying to find a way to mathematically rank the data in a row using only glide functionality, and so the results are sequential whole numbers. I feel like there is some magic math formula that could do this but I’ve been unable to figure it out or find a solution the didn’t suggest programmatically sorting and looping the data, or simply using a Rank function (which we don’t have…yet).

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [February 10, 2021, 2:24pm UTC](https://community.glideapps.com/t/rollup-by-rank/4551/14 "2021-02-10T14:24:14Z")

</div>

Thanks @Jeff_Hager!

Yes, you’re absolutely right! I’ve tried researching ways to mathematically rank a list of items and 99% of the posts out there are reference using the `=rank()` formula 🙄

Your thoughtfulness regarding the layout of the Rank Column is spot on 💯

---

<div class="post-metadata">

**Author:** ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)\
**Post date:** [February 10, 2021, 2:26pm UTC](https://community.glideapps.com/t/rollup-by-rank/4551/15 "2021-02-10T14:26:30Z")

</div>

I can’t even vote for my own post 😕  
 ![Screen Shot 2021-02-10 at 9.26.02 AM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/2/3/238e05ffd405b61c852c6c7febb9cff38973bfcf.png)

---

<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:** [February 10, 2021, 3:42pm UTC](https://community.glideapps.com/t/rollup-by-rank/4551/16 "2021-02-10T15:42:28Z")

</div>

Yeah, I was getting into math formulas that were well above my skill level and I had no idea if they were even what I was looking for. Seems simple, but apparently not.

---

<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 10, 2021, 3:46pm UTC](https://community.glideapps.com/t/rollup-by-rank/4551/17 "2021-02-10T15:46:39Z")

</div>

> [@Jeff\_Hager](#):
>
> getting into math formulas that were well above my skill level

Oh… so what, like Quantum Math? 😂

---

<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:** [February 10, 2021, 4:17pm UTC](https://community.glideapps.com/t/rollup-by-rank/4551/18 "2021-02-10T16:17:56Z")

</div>

Ha! Not quite. Finite Math (a little above algebra and a little below calculus) was as far as I got in college. Most of that knowledge is long gone. Anything above basic algebra is above my league. If there are symbols in the formula that aren’t letters or numbers, then I’m out. About the only symbol I know and understand is ∑ but I only know how to apply it programmatically.
