I have the following code to generate a random number between 0 and the number in Cell D16. The information on the sheet is being updated via a form and I want to know if there is a way to do an ArrayFormula with this code so that I can generate the numbers going down a column without having to type the code for each and every row.
function economyNegative() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName('SubmittedPolicies');
sheet.getRange('E16').setValue(Math.random() * sheet.getRange('D16').getValue());
}