如何使excel单元格计数器上升X量Y行数

时间:2017-01-16 10:35:29

标签: excel excel-2010

我有一组数据,我想过滤它,所以如果每个第4行包含某个单词,则所有上述4行都会变为零,否则它会保持不变,例如:

        mynode.run(SKAction.sequence([
           SKAction.wait(forDuration: 10),
           SKAction.run {
               mynode.removeFromParent()
           }
        ]))

我正在使用下面的代码,但很难让代码中的A4每4行增加4个。

1 A <--- turned into zero because the 4th row is x
2 A <--- turned into zero because the 4th row is x
3 A <--- turned into zero because the 4th row is x
4 X <--- turned into zero because the 4th row is x
5 A <--- stays the same because the 4th row is A
6 A <--- stays the same because the 4th row is A
7 A <--- stays the same because the 4th row is A
8 A <--- stays the same because the 4th row is A

以上示例的公式应如下:

=IF(ISNUMBER(SEARCH("X",A4)),0,A1)

1 个答案:

答案 0 :(得分:0)

艾哈迈德,这是我想出来的。它有点冗长,但它似乎做你想要的:

=IF(ISNUMBER(SEARCH("X",INDIRECT(ADDRESS(ROUNDUP(ROW(A1)/4,0)*4,1)))),0,A1)

此公式与您发布的内容相同,但计算最近的第4行(向上舍入)。这样,您应该能够复制并应用于整个列