Collection for random numbers

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,341
I create a single value which is the sum of various random numbers. I repeat this up to 100,000 times and currently I insert them in a worksheet and sort the results. I can then calculate the minimum, maximum, mean, mode, 5th percentile, etc. I'm wondering if I could speed up the process by sending the results to a Collection, a Dictionary or an Array. Does anyone have any thoughts about this?
 
Hi everybody. Many thanks for all the suggestions. They are greatly appreciated and I am very pleased with the answers. Yes, once I have the data sorted on a worksheet, I can easily do the other things. It had occurred to me that I might even be able to find things like the mean, minimum and fifth percentile (i.e. the 5,000th value in the 100,000 sorted list) without having to dump the values into a worksheet, but I am delighted with the impressive increase in speed. I have ticked Stephen's first reply as it gave me the answer to my initial question and I shall certainly consider upgrading to steam for my next computer.
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,214,990
Messages
6,122,626
Members
449,093
Latest member
catterz66

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top