I have a sheet on Google and keep looking for a solution on how to make randomizing script work only when it's needed, not every time I open the sheet or refresh it.
Here's the example. Let's take the sheet looks like this:
B5 cell has the following code:
=index(B1:B3; randbetween(1;3); 1)
It randomly tells me the hair color every time I refresh or load the document.
But what if I want the new hair color only once a week, but need to open the document from time to time?
I have tried to put a flag to the code.
And changed the code of B5:
=if(B7=true; index(B1:B3; randbetween(1;3); 1); )
So it initiates randbetween function only when the flag is checked.
BUT! When the flag is unchecked, the hair color is shown empty (right, 'cause it has a space in IF
function). How do I keep the hair color the same as it was before and make it change only if I check the flag?