vangogh228
Registered User.
- Local time
- Today, 05:27
- Joined
- Apr 19, 2002
- Messages
- 302
I am trying to teach the concept of randomness in a college statistics class. I was thinking of writing a macro that would loop a recalculation, and have a =RANDBETWEEN(1,100) formula in a certain cell. Then... and here's the part I cannot figure out... I want to COUNT the number of times each number comes up. That is, I want to have a list of the numbers 1-100 and a counter of some sort for each one. As the random number is generated in the RANDBETWEEN cell, it would be recorded as an occurence in the list. As the random numbers continue to be generated, the totals would continue to add up.
So, for example, the number beside "47" starts at "0". As the macro loops through the RANDBETWEEN recalculation, eventually it hits a "47." The counter for "47" then goes to "1". The looping continues and, when te RANDBETWEEN hits "47" again, the counter goes to "2".
Is this possible? If you have an easier solution, I would be open to suggestions.
Thanks.
Tom
So, for example, the number beside "47" starts at "0". As the macro loops through the RANDBETWEEN recalculation, eventually it hits a "47." The counter for "47" then goes to "1". The looping continues and, when te RANDBETWEEN hits "47" again, the counter goes to "2".
Is this possible? If you have an easier solution, I would be open to suggestions.
Thanks.
Tom