0

This is my function :

=NORMINV(RAND(),$A$1,$A$2)

When I do something other, the random number recalculate again

How can I make the random number static on the 1st

Green Hill
  • 23
  • 7

1 Answers1

0

This is how the RAND() function is meant to work in Excel. If you want a static number, you can just paste its value ;)

However, if you are open to using VBA, you can do it by performing manual calculations with your uncalculated cell in A1 for example :

sub refreshRand()
  range ("A1").formula = "=NORMINV(RAND(),$A$1,$A$2)"
  range ("A1").calculate
  range ("A1").value = range ("A1").value
end sub

Note: If you finished your work and want to stop all calculations on ALL cells in the sheet, you can set it in Excel Settings -> Manual Calculation

BassMHL
  • 8,523
  • 9
  • 50
  • 67
  • Any other function than RAND() can make static random number? – Green Hill Mar 30 '15 at 02:42
  • Not in Excel. But it can be easily done with VBA, are you familiar with coding in VBA? See this article : http://stackoverflow.com/questions/8011032/compute-a-static-random-number-compute-it-once-in-excel – BassMHL Mar 30 '15 at 02:46
  • Not really, but my random number is generated based on mean and standard deviation – Green Hill Mar 30 '15 at 03:00
  • In this case, use the first solutio, which is to hardcode the cell's value by pasting its value into the cell. You can always keep the cell with the formula next to it in case you want to regenerate a new random number ( you would just paste it again). That's all I can do for you, good luck! – BassMHL Mar 30 '15 at 03:04
  • I right click work sheet then > view code and i paste ur coding but it doest work – Green Hill Mar 30 '15 at 03:07