[Solved] Combine search for characters in two columns [closed]
DRY (don’t repeat yourself) code version looks like var sh = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var containsKey = function(range) { var column = sh.getRange(range).getValues(); var values = column.reduce(function (accumulator, currentValue) { return accumulator.concat(currentValue); }, []); return values.some(function (value) { return /[MWFmwf]/.test(value); }); } if (!(containsKey(“Imported!E2:E50”) || containsKey(“Imported!I2:I50”))) { genderMatch(); SpreadsheetApp.flush(); } ageCategories(); If you want more than two … Read more