简体   繁体   中英

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.

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.

(Quantity of outputs can vary not restricted to only 4 non empty cells in the column)

{=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:

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

In C3 enter:

=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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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