# Question about calculating average

**URL:** https://community.glideapps.com/t/question-about-calculating-average/42952
**Category:** Ask for Help
**Created:** [June 10, 2022, 7:43pm UTC](https://community.glideapps.com/t/question-about-calculating-average/42952 "2022-06-10T19:43:01Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Alvis\_Lo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alvis_lo/32/40398_2.png) [@Alvis\_Lo](https://community.glideapps.com/u/Alvis_Lo)
#### Post date: [June 10, 2022, 7:43pm UTC](https://community.glideapps.com/t/question-about-calculating-average/42952/1 "2022-06-10T19:43:01Z")

</div>

In my case, I need to calculate the average test result of my students. They did the testing 5 time, but som of them just did 4.  
If I set the Math as (test1+ test2+ test3+ test4+ test5)/5, for those students who did 5 test the answer is correct, but for those students who did4, it surely wrong, how can I set the Math which can fit both?

---

<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: [June 10, 2022, 9:39pm UTC](https://community.glideapps.com/t/question-about-calculating-average/42952/2 "2022-06-10T21:39:08Z")

</div>

The problem isn’t the math column, the problem is choosing dividing by 4 or 5, correct?

What I recommend is using the Make Array column instead of a math column. Select each of the 5 scores as an item in the array. Then use a rollup column → average that’s sourced from the Make Array column.

---

<div class="post-metadata">

### Author: ![justinjmp](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/justinjmp/32/43205_2.png) [@justinjmp](https://community.glideapps.com/u/justinjmp)
#### Post date: [June 10, 2022, 9:39pm UTC](https://community.glideapps.com/t/question-about-calculating-average/42952/3 "2022-06-10T21:39:48Z")

</div>

Hi Alvis,

Can you try:

1. Creating a relation of your students with their test scores
2. Doing a lookup on their scores
3. Doing a roll up count on their scores to find what to average by
4. Using a math column to average their test scores by the count of how many tests they have completed?

This should give you what you are looking for.

---

<div class="post-metadata">

### Author: ![justinjmp](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/justinjmp/32/43205_2.png) [@justinjmp](https://community.glideapps.com/u/justinjmp)
#### Post date: [June 10, 2022, 9:40pm UTC](https://community.glideapps.com/t/question-about-calculating-average/42952/4 "2022-06-10T21:40:35Z")

</div>

Much easier way of doing it!

---

<div class="post-metadata">

### Author: ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)
#### Post date: [June 10, 2022, 10:24pm UTC](https://community.glideapps.com/t/question-about-calculating-average/42952/5 "2022-06-10T22:24:26Z")

</div>

This is how the Robert’s suggestion is going to look like

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/c/6/c651a05d697eaf9e34d63cc9bd17119270cc7a25.png)

---

<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: [June 11, 2022, 1:54am UTC](https://community.glideapps.com/t/question-about-calculating-average/42952/6 "2022-06-11T01:54:29Z")

</div>

Exactly. Love the Make Array column 😉  
@David_Gabler

---

<div class="post-metadata">

### Author: ![Alvis\_Lo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alvis_lo/32/40398_2.png) [@Alvis\_Lo](https://community.glideapps.com/u/Alvis_Lo)
#### Post date: [June 11, 2022, 6:28am UTC](https://community.glideapps.com/t/question-about-calculating-average/42952/7 "2022-06-11T06:28:26Z")

</div>

Thanks for your great example… it’s very helpful 👍

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [June 12, 2022, 6:28am UTC](https://community.glideapps.com/t/question-about-calculating-average/42952/8 "2022-06-12T06:28:35Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
