function myFunction() {
var ss1 = SpreadsheetApp.getActiveSpreadsheet();
var sheet1 = ss1.getSheetByName("s1");
var data1 = sheet1.getRange(1, 1, sheet1.getLastRow(),1).getValues();
var val1=data1[0].toString();
var sheet1w = ss1.getSheetByName("s1");
var ss2 = SpreadsheetApp.getActiveSpreadsheet();
var sheet2 = ss2.getSheetByName("s2");
var data2 = sheet2.getRange(4, 2, sheet2.getLastRow()-3,1).getValues();
var val2=data2[0].toString();
var sheet2w = ss1.getSheetByName("s2");
/*
if (val1==val2){
console.log("same");
}else{
console.log("NG");
}
*/
var matched_flg ;
for (var i = 0; i < data1.length; i++) {
matched_flg=false;
for (var ii = 0; ii < data2.length; ii++) {
//console.log(data2[i]);
if (data1[i].toString()==data2[ii].toString()){
console.log("データ1:" + data1[i] + " データ2:" + data2[ii] + " " + "☆same") ;
sheet1w.getRange(i+1, 4).setValue(true);
sheet2w.getRange(i+4, 4).setValue(true);
matched_flg=true;
break;
} else{
console.log("データ1:" + data1[i] + " データ2:" + data2[ii] + " " + "☆different") ;
}
}
if (matched_flg==true) {
sheet2w.getRange(i+4, 4).setValue(true);
}
//console.log(data1[i]);
}
/*
console.log(val1==val2);
console.log(val1===val2);
console.log(data1[0].toString()==data2[0].toString());
console.log(data1[0]===data2[0]);
*/
}