vendredi 6 mars 2015

Sum n random numbers (for simulation purposes)

I am looking for an easy way to compute the sum of n random numbers in Excel.


For example, I can compute the sum of 5 (uniform) random numbers by the formula



=RND()+RND()+RND()+RND()+RND()


Is there a way to compute for example the sum of n random numbers with one single formula? I would expect to have a forumla in the following form...



=SUM(OFFSET(RND();0;0;n))


...but this formula doesn't work.


I know I can simply compute this by putting the formula =RND() in the range A:A and then use the OFFSET function to compute the sum of the n first elements, but this require me filling a large number of cells just to compute one value. (suppose I make more simulations of this random sum, it would become a mess)


Furthermore in this case the ananlytical disribution of the sum of uniform distributions is known. This is just for illustration purposes, I would like to compute this with any type of random numbers.





Aucun commentaire:

Enregistrer un commentaire