简体   繁体   English

计算增量空白单元格,直到下一个非空单元格(仅用于公式)

[英]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

Screenshot as well 截图
在此处输入图片说明

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.

相关问题 Excel - 计算列中的空单元格,直到找到非空单元格报告然后继续向下列直到找到下一个非空单元格 - Excel - Count Empty Cells in a Column until a Non Empty Cell is Found Report then Continue down column till next non empty cell is found 计算在下一个非空白单元格处停止的单元格上方的空白单元格 - Count blank cells above a cell stopping at the next non blank cell 计算最后一个单元格与下一个非空白单元格之间的行中的空白单元格数 - Count number of blank cells in row between last cell and next non-blank cell 在Excel中,如何计算空白单元格的数量,直到下一个非空白单元格 - In Excel, How do I count the number of blank cells until the next non-blank cell 计算非空白单元格下方的空白单元格数 - Count the number of blank cells below a non-blank cell 如何复制包含空白单元格中包含公式的列中的最后一个非空白单元格 - How to copy the last non-blank cell in a column that contains blank cells with formulas in them VBA-使用单元格引用计数非空白单元格 - VBA - Count Non Blank Cells Using Cell Reference Excel - 计算所有非空单元格,不包括空字符串 - Excel - Count all non-blank cells, excluding empty string 代码以找到excel列中连续非空单元格的总和,直到出现空单元格? - code to find the sum of continuous non-empty cells in a column in excel till the empty cell occurs? 在单列中填充范围内的单元格,但仅填充下一个空白单元格 - Fill Cells in range in single Column, but Only the next blank cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM