Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default How to save random numbers?

Hi folks,

Hopefully someone can help me with this question - it bothers me for hours now and I can't find the answer anywhere on the WWW.

I'm making an excel file with a statistic experiment for students. It involves grabbing balls out of a vase, like the example in almost any maths book. A random number determines the color of a grabbed ball - so far so good. But I'm not able to make a cumulative list or summation of the generated random numbers whatsoever. Is there any way to make a function or formula that summates the generated random numbers everytime the number is regenerated?

For example: when the random numbers are 5, 6 and 7 after refreshing three times, is there a formula that can tell you what the sum of those individual numbers is?

Hopefully my question is clear.

Thanks in advance for any help!

Cheers from Holland,

Rangemaster.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 829
Default How to save random numbers?

"Rangemaster" wrote:
But I'm not able to make a cumulative list or summation
of the generated random numbers whatsoever. Is there any
way to make a function or formula that summates the generated
random numbers everytime the number is regenerated?
For example: when the random numbers are 5, 6 and 7 after
refreshing three times, is there a formula that can tell
you what the sum of those individual numbers is?


Instead of "refreshing three times", put your random formula into 3 cells.
For example, =RANDBETWEEN(1,50) into A1, A2 and A3. Then the sum can be
computed in A4 with the formula =SUM(A1:A3).

Every time you press F9, a new set of 3 random numbers will be generated in
A1:A3, and A4 will be their sum.

The real problem is: that also happens every time your edit any cell in any
worksheet in the workbook, and when Excel decides to recalculate for any
other reason.

If you don't want that (most people don't), copy A1:A3 and use
paste-special-value to paste a set of random numbers into B1:B3. Then use
=SUM(B1:B3) to maintain their sum.

A1:A3 will continue to change on their own. But they will not affect your
sum (of B1:B3) unless and until you copy and paste-special-value A1:A3
again.

If you do not like that manual procedure, there are alternatives. Let me
know if you want to hear about them.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How to save random numbers?

Not sure if you can see this as I'm asking 1 1/2 years later but I'd like to know how to "save" the random numbers that are generated.

I have been able to generate numbers from 1 to 100 with two decimal places but I can't figure out how to create a history of previously generated numbers. It would be nice to be able to graph them on a line graph as well so as soon as I can keep a list then that won't be a problem.

Thanks.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 829
Default How to save random numbers?

wrote:
I have been able to generate numbers from 1 to 100 with two
decimal places but I can't figure out how to create a history
of previously generated numbers.


Enter the following formula into A1:

=RANDBETWEEN(100,10000)/100

Copy A1 into A2:A1000. Copy A1:A1000, then use Paste-Special-Value to put
the values (not the formulas) back into A1:A1000 or somewhere else.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How to save random numbers?


If you do not like that manual procedure, there are alternatives. Let me
know if you want to hear about them.


hi!

I'd like to avoid manual procedure,

used =arrayformula(If(ISNUMBER(P3), ainaRand(), IFERROR(1/0))) where ainaRand is my short function to generate random #:

function ainaRand() {
var number = Math.floor(Math.random() * 10 + 1);
return number;
}

I read it would stabilize the random # but it still changes every 30 min or so.

Do you have other way to avoid the change of random # here?

Thanks - Artu


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How to save random numbers?


If you do not like that manual procedure, there are alternatives. Let me
know if you want to hear about them.


hi!

I'd like to avoid manual procedure,

Could you share your way to avoid changing of random # here?
Can be copy and paste-special-value be done via code?

Thanks - Artu

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,182
Default How to save random numbers?

If you do not like that manual procedure, there are alternatives.
Let me know if you want to hear about them.


hi!

I'd like to avoid manual procedure,

used =arrayformula(If(ISNUMBER(P3), ainaRand(), IFERROR(1/0))) where
ainaRand is my short function to generate random #:

function ainaRand() {
var number = Math.floor(Math.random() * 10 + 1);
return number;
}

I read it would stabilize the random # but it still changes every 30
min or so.

Do you have other way to avoid the change of random # here?

Thanks - Artu


Change the cell to a value...

select cell
Copy
PasteValue -OR- right-click, Paste Special..., Values

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How to save random numbers?

On Thursday, October 15, 2015 at 3:54:15 PM UTC-7, GS wrote:
If you do not like that manual procedure, there are alternatives.
Let me know if you want to hear about them.



Change the cell to a value...

select cell
Copy
PasteValue -OR- right-click, Paste Special..., Values

--
Garry

__________________________

Garry,

joeu2004 already offered Copy - Paste Special Values previously.

(s)he also mentioned other ways to go beyond MANUAL way

I open to learn them

Thanks

Artu
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save Random Number Paul B. Excel Worksheet Functions 5 April 3rd 15 03:50 AM
getting numbers divisible by 4 from random numbers in ascending order ramana Excel Worksheet Functions 6 June 19th 07 06:41 PM
Can Excel pick random numbers from 1-300 and not repeat numbers? Julian Excel Discussion (Misc queries) 1 June 7th 06 07:17 AM
Non-random numbers generated by excel's data analysis random gener Allie Excel Worksheet Functions 10 September 17th 05 06:19 AM
Non-random numbers generated by excel's data analysis random gener Harlan Grove Excel Discussion (Misc queries) 2 September 13th 05 04:06 PM


All times are GMT +1. The time now is 05:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"