I have a sheet with an array of values that goes from A1 to BK288. This array is a percentage calculation based on another spreadsheet that updates every 5 minutes. Now I would like to receive an email notification when one value on the same row in different columns increase and become greater then a fixed value. Then the email should contain that volue on the body and the title of the column on the subject. I wrote this script but is for a single cell, I don't know if there is a way to extend it for every column, apart writing a function for every column. Also, is there a way to trigger an automatic notification? Consider the sheet updates the values every 5 minutes. Thanks
function getValue() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Perc");
var value = sheet.getRange("A288").getValue();
var title = sheet.getRange("A1").getValue();
if(value >= "2") sendEmail(value, title)
};
function sendEmail(value, title){
var recipient="[email protected]";
var subject=title + " price";
var body=title + " price has changed by " + value + "%";
MailApp.sendEmail(recipient, subject, body);
};