# How to do roll-up on the last 10 rows

**URL:** <https://community.glideapps.com/t/how-to-do-roll-up-on-the-last-10-rows/32611>\
**Category:** Ask for Help\
**Created:** [October 3, 2021, 11:29pm UTC](https://community.glideapps.com/t/how-to-do-roll-up-on-the-last-10-rows/32611 "2021-10-03T23:29:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![YOUNGMIN](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/youngmin/32/31663_2.png) [@YOUNGMIN](https://community.glideapps.com/u/YOUNGMIN)\
**Post date:** [October 3, 2021, 11:29pm UTC](https://community.glideapps.com/t/how-to-do-roll-up-on-the-last-10-rows/32611/1 "2021-10-03T23:29:19Z")

</div>

Is there any way to sum or average other table’s last 10 rows not the entire rows?  
I can have a roll-up column to calculate average or sum of the entire rows but can’t find ways to do on specific rows.

---

<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:** [October 3, 2021, 11:33pm UTC](https://community.glideapps.com/t/how-to-do-roll-up-on-the-last-10-rows/32611/2 "2021-10-03T23:33:59Z")

</div>

Do you have this data in the Sheets or Glide Tables? I think we would need an incremental “row number” here to do this.

---

<div class="post-metadata">

**Author:** ![YOUNGMIN](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/youngmin/32/31663_2.png) [@YOUNGMIN](https://community.glideapps.com/u/YOUNGMIN)\
**Post date:** [October 3, 2021, 11:36pm UTC](https://community.glideapps.com/t/how-to-do-roll-up-on-the-last-10-rows/32611/4 "2021-10-03T23:36:58Z")

</div>

Always appreciate your help.  
The rows are in the sheet and I have another Glide table for roll-up. What’s the next step if I have an incremental row number in the sheet?

---

<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:** [October 3, 2021, 11:40pm UTC](https://community.glideapps.com/t/how-to-do-roll-up-on-the-last-10-rows/32611/5 "2021-10-03T23:40:44Z")

</div>

Yeah assume you have an incremental row number like 1, 2, 3, etc.

Create a rollup in the same sheet and get the max number in that incremental column.

Create a math column, let’s call it “Last 10 limit”. The formula would be:

Max - 9 with Max being the number from the max rollup.

Next, an If Then Else column. If row number greater than or equal to “Last 10 limit” then return the desired value you want to rollup originally, else 0 or empty.

Finally, rollup on the ITE column.
