I am a novice...and a bit thick.

I have written an IF Function;

=IF(A2>=1,RANDBETWEEN(1,9),)

It returns a value between 1 and 9 if A2 is 1, which great and exactly what I need. However, when A2 is 0, I need there to be no change.

Do I even need to use an IF function?

Basicallly if A2 = 1 then I need it to produce a random number between 1 and 9.
if A2 = 0 then I need it to stay the same, or repeat the previous value.

Any help would be greatly appreciated.