简体   繁体   English

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

Example of what I mean我的意思的例子

A column that is 40 cells long. 40 个单元格长的列。

The output will count how many empty spaces are till the first non empty value输出将计算有多少空格,直到第一个非空值

The second output will show count how many empty spaces from the next first empty space till the next non empty space.第二个输出将显示从下一个第一个空白空间到下一个非空白空间有多少个空白空间。

The third output will show count how many empty spaces from the previous non empty space to the next non empty space.第三个输出将显示从前一个非空白空间到下一个非空白空间有多少个空白空间。

etc etc till it reaches the 40th cell.等等等等直到它到达第40个单元格。

(Quantity of outputs can vary not restricted to only 4 non empty cells in the column) (输出的数量可以变化,不仅限于列中的 4 个非空单元格)

{=MATCH(FALSE,ISBLANK(B1:F1),0)-1} 

This will give me the output for the number of blank spaces till the first non empty space.这将为我提供空格数的输出,直到第一个非空白空间。 I've tried various different ways to try and get it to continue going through the cells and resuming form where it last reported, but couldnt get anything to work.我尝试了各种不同的方法来尝试让它继续通过单元格并恢复上次报告的表单,但无法获得任何工作。 Any suggestions?有什么建议?

Thanks!谢谢!

In C2 enter:C2 中输入:

=MATCH("*",B:B,0)-1

In C3 enter:C3 中输入:

=MATCH("*",INDEX(B:B,SUM($C$1:C2)+ROWS($1:2)):INDEX(B:B,9999),0)-1

and copy downward:并向下复制:

在此处输入图片说明

Note(s):笔记):

  • the formulas treat the column as a series of blocks, each block being a set of sequential empty cells between two non-empty cells公式将列视为一系列块,每个块是两个非空单元格之间的一组连续空单元格
  • from the position of the boundary cells, the formulas calculate the number of empties between them从边界单元格的位置,公式计算它们之间的空数

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM