我要計數的A隊連續3勝的數量和B.它似乎總是給我最後的IFS。不是當consecutivas等於3,6,9 ......%運營商似乎沒有在谷歌工作的Apps腳本
var consecutivasA = 0;
var consecutivasB = 0;
var plusA = 0;
var plusB = 0;
for (var i = 2; i <= 30; i++) {
var row = values[i];
if (row[3] > row[4]) {
consecutivasA++;
consecutivasB = 0;
}
else if (row[3] < row[4]) {
consecutivasB++;
consecutivasA = 0;
}
else {
consecutivasA = 0;
consecutivasB = 0;
}
if (consecutivasB % 3 == 0) { plusB++; }
if (consecutivasA % 3 == 0) { plusA++; }
就是這樣,謝謝:) – Pepe