#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default Random Numbers

i am trying to run a precipitation model and am using the Rand() function to
help generate numbers inbetween certain values. I am also using solver in my
spreadsheets, The solver is having a hard time calculating everything
because the random numbers are being regenerated every time. Without Copy
and Special Pasteing the Value of the generated random number, is there
another way i can keep the Rand() function from generating new numbers
everytime and only when i tell it too.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default Random Numbers

Short answer is 'No'.

Whenever the worksheet gets recalculated, RAND() will generate a new number.

"Soccer boy" wrote:

i am trying to run a precipitation model and am using the Rand() function to
help generate numbers inbetween certain values. I am also using solver in my
spreadsheets, The solver is having a hard time calculating everything
because the random numbers are being regenerated every time. Without Copy
and Special Pasteing the Value of the generated random number, is there
another way i can keep the Rand() function from generating new numbers
everytime and only when i tell it too.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Random Numbers

No, not with RAND. Can you use a VB solution... that can be made to generate
random numbers without their constantly changing. If a VB solution is
possible for you, then describe how they should work. Do you need upper and
lower bounds, or is 0 to just under 1 good enough? Can there be repeats or
not? Any other restrictions?

--
Rick (MVP - Excel)


"Soccer boy" wrote in message
...
i am trying to run a precipitation model and am using the Rand() function
to
help generate numbers inbetween certain values. I am also using solver in
my
spreadsheets, The solver is having a hard time calculating everything
because the random numbers are being regenerated every time. Without Copy
and Special Pasteing the Value of the generated random number, is there
another way i can keep the Rand() function from generating new numbers
everytime and only when i tell it too.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default Random Numbers

On Jan 26, 2:47 pm, Soccer boy
wrote:
Without Copy and Special Pasteing the Value of the
generated random number, is there another way i can
keep the Rand() function from generating new numbers
everytime and only when i tell it too.


Not directly. But if you are amenable to using a VBA function, you
can bury the random number generation by using the VBA Rnd()
function. For example:

function myrand(optional rng as range) as double
myrand = rnd()
end function

With the optional range parameter, you can call it with simply MyRand
() or MyRand(A1). With the latter form, MyRand will be called
whenever A1 is modified (and whenever the worksheet is recalculated as
a whole).


----- original posting -----

On Jan 26, 2:47*pm, Soccer boy
wrote:
i am trying to run a precipitation model and am using the Rand() function to
help generate numbers inbetween certain values. *I am also using solver in my
spreadsheets, *The solver is having a hard time calculating everything
because the random numbers are being regenerated every time. *Without Copy
and Special Pasteing the Value of the generated random number, is there
another way i can keep the Rand() function from generating new numbers
everytime and only when i tell it too.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Random Numbers

i am trying to run a precipitation model and am using the Rand()
function to help generate numbers inbetween certain values. I am also
using solver in my spreadsheets, The solver is having a hard time
calculating everything because the random numbers are being
regenerated every time. Without Copy and Special Pasteing the Value
of the generated random number, is there another way i can keep the
Rand() function from generating new numbers everytime and only when i
tell it too.


One way is to first allow circular references by checking the box:
Tools Options Calculation Iteration

Then in B1 use a formula like:
=IF($A$1="",RAND(),B1)

As long as A1 is non-empty, B1 won't change.

Caution: allowing circular references can be a risk. Later, if you make a
circular reference in the workbook by mistake, Excel won't flag it as an
error.
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
getting numbers divisible by 4 from random numbers in ascending order ramana Excel Worksheet Functions 6 June 19th 07 06:41 PM
How to select top six numbers from a of range of random numbers Jack M Taylor Excel Worksheet Functions 4 January 30th 07 09:18 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 01:26 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"