Up until the arrival of dynamic arrays to Excel I ran Monte Carlo simulations using the DATA TABLE as in range D2:D11 in the example below. Notice that each cell in that range is an independent trial of the computation in D2. Now, if I want to change the number of trials, I have to retype the DATA TABLE formula over a different range, since the range of the DATA TABLE is fixed.
I am trying to avoid this retyping by using dynamic arrays. The 'solution' in column E does not work because, even though it is a dynamic array, it copies the same trial from D2 in the entire range. It does not 'recalculate' before spilling down the range.
In sum, what I need is to find a way of 'spilling' recalculated values for D2 through some dynamic range of a size determined in a cell like B2.
Your help is kindly appreciated.
PS: I'm aware that I could do something like what's in column F, but I'm then hardcoding the formulas in B3 and B4 into F2, instead of referring to the previously computed sum in D2.
Book4 | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | X + Y | X + Y | X + Y | |||||
2 | # of Trials | 10 | -0.6900433 | -0.6900433 | 4.90230132 | |||
3 | Variable X | 0.24648968 | 0.13805136 | -0.6900433 | 0.24279177 | |||
4 | Variable Y | -0.936533 | -3.2810933 | -0.6900433 | -1.0600791 | |||
5 | -0.7484546 | -0.6900433 | -2.6619196 | |||||
6 | 0.65908836 | -0.6900433 | 5.2650448 | |||||
7 | 0.17844114 | -0.6900433 | -0.9840348 | |||||
8 | 2.18178978 | -0.6900433 | -0.2933348 | |||||
9 | -3.7196496 | -0.6900433 | -0.7381979 | |||||
10 | 0.65436751 | -0.6900433 | 1.15480195 | |||||
11 | 1.29903028 | -0.6900433 | 1.60067112 | |||||
Sheet2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E2:E11 | E2 | =SEQUENCE(B2,,D2,0) |
F2:F11 | F2 | =NORM.S.INV(RANDARRAY(B2))+T.INV(RANDARRAY(B2),2) |
B3 | B3 | =NORM.S.INV(RAND()) |
B4 | B4 | =T.INV(RAND(),2) |
D2 | D2 | =B3+B4 |
D3:D11 | D3 | =TABLE(,E1) |
Press CTRL+SHIFT+ENTER to enter array formulas. | ||
Dynamic array formulas. |
I am trying to avoid this retyping by using dynamic arrays. The 'solution' in column E does not work because, even though it is a dynamic array, it copies the same trial from D2 in the entire range. It does not 'recalculate' before spilling down the range.
In sum, what I need is to find a way of 'spilling' recalculated values for D2 through some dynamic range of a size determined in a cell like B2.
Your help is kindly appreciated.
PS: I'm aware that I could do something like what's in column F, but I'm then hardcoding the formulas in B3 and B4 into F2, instead of referring to the previously computed sum in D2.