# 'Average of list' block not working correctly?

**URL:** <https://community.thunkable.com/t/average-of-list-block-not-working-correctly/550119>\
**Category:** Questions about Thunkable X\
**Tags:** list, average\
**Created:** [April 1, 2020, 4:10pm UTC](https://community.thunkable.com/t/average-of-list-block-not-working-correctly/550119 "2020-04-01T16:10:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 1, 2020, 4:10pm UTC](https://community.thunkable.com/t/average-of-list-block-not-working-correctly/550119/1 "2020-04-01T16:10:42Z")

</div>

Hello.  
[EDIT w/ cleaner examples]

i am trying to return the average from 4 numbers. using this code  
 ![Screen Shot 2020-04-01 at 12.04.02 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/7/67229454c77a828628af52fae96113a0edae6d2f.png)

`<>Y values` is 4 numbers. 5,2,1,0 as seen here but i get a weird number

 ![IMG_1355](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/4/840c6e6ea5b84923cec169c826e73eb43b5187a6.jpeg)  
I also get this value returned when i divide the sum of list Yvalues by the length of list Yvalues

what’s going on here.  
am i doing something wrong?

This is the entire code. I insert a list of y values as is seen in the example above. the rest of the code should produce two data points. a start and end point for a trend line.

 ![Screen Shot 2020-04-01 at 12.05.47 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/a/2a8068e7c00e9df9c3e20a1bcec04fa5dfeb2f24.png)  
when i run the whole code, \<\>m and \<\>b return as NaN.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [April 1, 2020, 5:24pm UTC](https://community.thunkable.com/t/average-of-list-block-not-working-correctly/550119/2 "2020-04-01T17:24:57Z")

</div>

it’s funny but your y-values 5,2,1,0 without the commas is 5210 , which when divided by 4 becomes 1302.5  
you may have entered 5,2,1,0 as a text string and it got processed as 5210, maybe it should be built as a list of 4 numbers.  
just guessing.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [April 1, 2020, 5:37pm UTC](https://community.thunkable.com/t/average-of-list-block-not-working-correctly/550119/3 "2020-04-01T17:37:20Z")

</div>

I think you’re right.

I hadn’t even considered that.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/d/ddfef2eb1c9360673f5282fd35a0ed41b5d7bcf6.jpeg)

We’re on a quest rn, but I’ll try to turn text into a list and report back

#covid19cantkeepmehome

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:39am UTC](https://community.thunkable.com/t/average-of-list-block-not-working-correctly/550119/4 "2024-11-08T11:39:29Z")

</div>


