2 replies

DR

I didn't quite get it. Could you please describe it in more detail.

1. Array Set
    %arr = 1,2,3

2. Array Join
    %arr join by
            +

3. Variable Set
    %sum set to
            %arr
    Do maths (ticked)

4. Variable Set
    %mean set to
            (%arr) / %arr(#)
    Do maths (ticked)

Even easier with the latest Tasker version :)

Test Math (155)
A1: Array Set [ Variable Array:%numbers Values:1,2,3,4,5 Splitter:, ]
A2: Variable Set [ Name:%result To:(%numbers(++))/%numbers(#) Recurse Variables:Off Do Maths:On Append:Off Max Rounding Digits:3 Structure Output (JSON, etc):On ]
A3: Flash [ Text:%result Long:Off ]

Join your array with a + and then "variable set" the result using "do maths". That will give you the sum.

Variable set "%joined_array / %unjoined_array(#)" with do maths to get the mean.

Brilliant 😄