cancel
Showing results for
Did you mean:

## Choice field with numbers, get average

Hi,

I'm having trouble building a flow which would take the inputs of a choice field (which are grades 1-5, single selection) and than take all the grades and calculate an average...

Any ideas ?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

Hi there,

It being a choice field and not a number field is no problem - that's what the "int()" takes care of for us.

For the other part..... you've said you've got it split into the students, so you could build an array, "append to array variable" per student of their grade.. then use this:

https://www.tachytelic.net/2021/06/power-automate-instant-sum-array/

and divide by the length of the array.

I think that would do it. I've not tried this before - let me know if it makes sense as you work through it, or if you need more detail - i should be able to provide more detail / screenshots later in the day.

# ______________________________________________________________

Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!

4 REPLIES 4
Super User

Hmm... sounds fun. Let's see!

Here's my form for demo:

This would be easy if Power Automate didn't only let us use 2 numbers in "add". 🙄

I only have 3 values incoming, so I just nested an "add", then divided by the # of questions.

How many questions like this will you have in your list? If it's a lot, we could also add them to an array and add them all together that way.

There is a post about how to do that, here:

https://www.tachytelic.net/2021/06/power-automate-instant-sum-array/

# ______________________________________________________________

Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!

Hi,

Let me explain how my list looks:

A                   1

B                   3

A                   5

C                   3

etc.

I know how to filter out the required student in the query, also I did exclude empty grade entries.. However I'm not sure how to do an average of all the grades. (each student could have up to 50 grades, even more). The issue is that the column is choice field and not a number column...

Super User

Hi there,

It being a choice field and not a number field is no problem - that's what the "int()" takes care of for us.

For the other part..... you've said you've got it split into the students, so you could build an array, "append to array variable" per student of their grade.. then use this:

https://www.tachytelic.net/2021/06/power-automate-instant-sum-array/

and divide by the length of the array.

I think that would do it. I've not tried this before - let me know if it makes sense as you work through it, or if you need more detail - i should be able to provide more detail / screenshots later in the day.

# ______________________________________________________________

Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!

It works. Thanks a lot 🙂

Announcements