[英]Count incremental blank cells till next non empty cell (Formulas Only)
My data looks like below. 我的数据如下所示。 I want to count consecutive blank cells till next non empty cell. 我想计数连续的空白单元格,直到下一个非空单元格。 My logic is to get output, when A2
contains data then it will return 0
but when A3
is blank then I expect 1
and continue to count blank cells incrementally. 我的逻辑是获取输出,当A2
包含数据时,它将返回0
但是当A3
为空白时,我期望为1
并继续对空白单元格进行递增计数。
Part_No Location Expected_Output
ABC123 North 0
South 1
XYZ123 East 0
South 1
West 2
PQR123 South 0
East 1
North 2
West 3
BROF-2 South 0
East 1
Hope someone will help me to solve my problem. 希望有人能帮助我解决我的问题。 Thanks. 谢谢。
如果空格在行列A中,请尝试此操作
=COUNTBLANK(INDIRECT("A"&LOOKUP(2,1/($A$2:A2<>""),ROW($A$2:A2))&":A"&ROW()))
In Range C2, use the formula: 在范围C2中,使用公式:
=IF($A2<>"",0,$C1+1)
and then copy down- should do the trick. 然后复制下来-应该可以解决问题。
Hope this helps, TheSilkCode 希望这会有所帮助,TheSilkCode
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.