Google Sheets Apps Script: Generate a Random Number Using Min/Max From the Active Row This video shows how to modify a Google Sheets Apps Script random number generator so it reads the minimum and maximum values from the same row as the active cell, instead of using hardcoded numbers. It explains why a custom function can’t use setValue (it must return a value) and why that recreates RANDBETWEEN behavior that recalculates periodically. The script uses getActiveRange().getRow() to capture the current row, then getActiveSheet().getRange(row, 5).getValue() and getRange(row, 6).getValue() to fetch min/max from columns E and F, and finally sets a fixed random number into the active cell. It also demonstrates debugging with Logger.log and checking results in Apps Script Executions logs. 00:00 Recap Random Numbers 00:37 Menu Script Demo 01:22 Why Custom Functions Fail 03:01 Read Min Max From Row 04:42 Test The Updated Script 05:01 Debug With Logger 05:29 Verify Executions Logs 07:32 Wrap Up And Next Videos