I’m looking for a way to compute a random number once in Excel. So its computed the first time its called, but then it doesn’t change afterwards.
So for example, if I had something like this in B1 RANDONCE(A1), then the first time I put a value in A1 it would compute a random value but then it wouldn’t change again. Or at least not until I changed A1 again.
I would like to do this without manually recopying B1 to turn it from a formula to a value as described here. Use of macros is fine.
You need a UDF with memory, so it knows if the cell has changed
This UDF will return a new random value when the refered to call changes, otherwise returns the last random value (ie no change)
Also return blank if source cell is blank (may or may not be what you require?)
Note: it has the problem that the
Staticvalues are lost when the sheet is closed, so the value will change each time the sheet is opened.