Answer the question
In order to leave comments, you need to log in
How to make RANDBETWEEN function triggered by date?
Is it possible to have the RANDBETWEEN function change value only by date, such as once a day or once a month?
Answer the question
In order to leave comments, you need to log in
The formula to implement this process will require iterative calculations and a very complex formula.
Try using a trigger on a function generateValue
:
function generateValue() {
var spreadsheet = SpreadsheetApp.getActive();
var from = 1;
var to = spreadsheet.getRange('Sheet1!C5').getValue();
var rand = randBetween_(from, to);
spreadsheet.getRange('Sheet1!D5').setValue(rand);
}
function randBetween_(from, to){
return Math.floor(Math.random()*(to - from + 1) + from);
}
from
for randBetween_
equals 1
, and the second to
is taken from the Table. The trigger is configured in such a way that the data in the cell is D5
updated periodically.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question