How do I write my formula to automatically regenerate a RAND () i.

G

Guest

I have developed a formula to generate a random number between 0 and 1, (RAND
()). I take the product and apply some additional calculations. At a later
step, (step 4) I want the program to automatically regenerate a new random
number if a condition has not been met, (in my case, if W is >1). Nothing I
try seems to work. I always get hung up on the automatic part. Any ideas?
Thank you very much.
 
J

JE McGimpsey

What is "step 4" referring to. Is "the program" a VBA program? If so,
something like this should work:

Assume cell A1 contains the random reference, and you get your W value
from cell A2.

Do Until W > 1
Range("A1").Calculate
W = Range("A2").Value
Loop
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top