アットウィキロゴ

かくて

var point=new Array();
var delta=new Array();
 
function myFunction() {
 
  ex = SpreadsheetApp.openById("1STm3E0doIYJkJ6t9zyikvKPIbVnMw8ZFQxM5HvmkH24");
  sh = ex.getSheetByName("2013");
  var v=sh.getRange(1,1,50,78).getValues();  
 
    for(s=1;s<78;s++){
    point[s]=0;
    }
 
  for(s=1;s<78;s++){
 
  c1=v[1][s];
  c2=v[2][s];
  c0=v[0][s];
 
 
h=0;   
if(c1=="農林水産業")h=h+1;
if(c2=="〇")h=h+1;
if(h==2)point[1]=s;
h=0;   
if(c1=="鉱業")h=h+1;
if(c2=="〇")h=h+1;
if(h==2)point[2]=s;
 
if(c2=="食料品")point[3]=s;
if(c2=="繊維")point[4]=s;   
if(c2=="パルプ・紙")point[5]=s;
if(c2=="化学")point[6]=s;   
if(c2.indexOf("石炭")>-1)point[7]=s;
if(c2.indexOf("窯業")>-1)point[8]=s;  
if(c2=="鉄鋼")point[9]=s;
if(c2=="非鉄金属")point[26]=s;   
if(c2=="金属製品")point[10]=s;
if(c2=="一般機械")point[11]=s;   
if(c2=="電気機械")point[12]=s;
if(c2=="輸送用機械")point[13]=s;  
 if(c2=="精密機械")point[14]=s;
if(c2.indexOf("その他")>-1)point[15]=s;   
if(c1=="建設業")point[16]=s;
h=0;   
if(c1.indexOf("ガス")>-1)h=h+1;
if(c2=="〇")h=h+1;
if(h==2)point[17]=s;
h=0;   
if(c1.indexOf("卸売")>-1)h=h+1;
if(c2=="〇")h=h+1;
if(h==2)point[18]=s;
 
if(c1=="金融・保険業")point[19]=s;
 
h=0;   
if(c1.indexOf("不動産業")>-1)h=h+1;
if(c2=="〇")h=h+1;
if(h==2)point[20]=s;
 
 
if(c1=="運輸業")point[21]=s;
 
h=0;   
if(c1.indexOf("情報通信業")>-1)h=h+1;
if(c2=="〇")h=h+1;
if(h==2)point[22]=s;
 
h=0;   
if(c1.indexOf("サービス業")>-1)h=h+1;
if(c2=="〇")h=h+1;
if(h==2)point[23]=s;
 
h=0;   
if(c0=="政府サービス生産者")h=h+1;
if(c1=="〇")h=h+1;
if(c2=="〇")h=h+1;
if(h==3)point[24]=s;
 
if(c0=="対家計民間非営利サービス生産者")point[25]=s;
 
  }
 
 
  s=25;
  for(sx=1;sx<27;sx++){
  s1=point[sx];
  delta[sx]=v[s][s1];
  }
 
  delta[9]=delta[9]+delta[26];
 
   ex2 = SpreadsheetApp.openById("1BEBIpPOB51M7YaaWKWy03383FJki2GHSt017uC3pWTw");
  sh2 = ex2.getSheetByName("data");
   for(s=1;s<26;s++){
  sh2.getRange(s+1,2).setValue(delta[s]);  
  }
 
 
 
}
 
最終更新:2017年08月21日 23:41