Google App Script foreach Spread Sheet function foreachSampleForSpreadSheet() { var sheet = SpreadsheetApp.getActiveSheet(); var data = sheet.getDataRange().getValues(); data.forEach(function (row, y) { row.forEach (function (cell, x) { if (typeof(cell) === 'string') { // WTF index! Logger.log(y + "," + x + ": " + cell + ", " + data[y][x] + ", " + sheet.getRange(y + 1, x + 1).getValue()); //sheet.getRange(y + 1, x + 1).setValue("hello world"); } }); }); }; Google Drive function foreachSampleForGoogleDrive() { var files = DriveApp.getFiles(); while (files.hasNext()) { var file = files.next(); Logger.log(file); } }