So I have a two dimensional array. I want to get the standard deviation of all of the second dimensions values for each first dimension. So for example:
itemArr(1 to 3, 1 to 2)
{20, 40
30, 60
40, 80}
Stdev(20,40) = 14.14214
Stdev(30,60) = 21.2132
Stdev(40,80) = 28.28427
I have tried this simple example with a 1D array with success:
If I had the below array and code, it would run just fine.
itemArr(1 to 3)
{20
40
60}
Stdev(20,40,60) = 20
But I am not sure what the syntax is for trying it in 2D:
With the below example where eachItem is an integer to reference an array dimension, I don’t know the proper syntax for executing this
itemArr(1 to 3, 1 to 2)
{20, 40
30, 60
40, 80}
Stdev(20,40) = 14.14214
Stdev(30,60) = 21.2132
Stdev(40,80) = 28.28427
This attempt will potentially get my point across but I can definitely explain another way and/or in more detail if needed.
Appreciate any input. Thanks in advance.
itemArr(1 to 3, 1 to 2)
{20, 40
30, 60
40, 80}
Stdev(20,40) = 14.14214
Stdev(30,60) = 21.2132
Stdev(40,80) = 28.28427
I have tried this simple example with a 1D array with success:
If I had the below array and code, it would run just fine.
Code:
finalStdDev = WorksheetFunction.StDev(itemArr)
{20
40
60}
Stdev(20,40,60) = 20
But I am not sure what the syntax is for trying it in 2D:
With the below example where eachItem is an integer to reference an array dimension, I don’t know the proper syntax for executing this
Code:
finalStdDevArr(eachItem) = WorksheetFunction.StDev(itemArr(eachItem),1 to itemCountArr(eachItem))
{20, 40
30, 60
40, 80}
Stdev(20,40) = 14.14214
Stdev(30,60) = 21.2132
Stdev(40,80) = 28.28427
This attempt will potentially get my point across but I can definitely explain another way and/or in more detail if needed.
Appreciate any input. Thanks in advance.