# How do I set average number from other points

Get help using Construct 2

### » Fri Jul 08, 2016 11:24 pm

I have VariableA and VariableB
every time when i start play game timer is start
every 1second add to variableA + 1

When i need quit i click submit and i send this value of VariableA to variableB
But every time when i do this variable B should show average of all added varlues
B
25
S
8
Posts: 224
Reputation: 2,191

### » Fri Jul 08, 2016 11:54 pm

You can't store an average in one variable. You need to store each variableA when you quit, so that you can take the average of all of the values.
B
71
S
22
G
280
Posts: 3,840
Reputation: 154,382

### » Sat Jul 09, 2016 7:44 am

@blackhornet so i must create multiple variables for this?
B
25
S
8
Posts: 224
Reputation: 2,191

### » Sat Jul 09, 2016 1:19 pm

You need an array. Then store the array. OR, you need two variables. One for the sum (variableB), and one for the number of times the sum has been added (variableC). Then your average is variableB/variableC.
B
71
S
22
G
280
Posts: 3,840
Reputation: 154,382