Need to count blank cells b/w two non blank cells

proficient

Well-known Member
Joined
Apr 10, 2012
Messages
745
Office Version
  1. 2016
Platform
  1. Windows
  2. Mobile
Hi All,

need to know the formula that counts blank b/w two non-blank cells in a rage.

Let's say A1:A14 has below data

Kamran
Blank
Blank

Mumtaz
Blank
Blank
Blank

Ahmed
Blank
Blank
Blank
Blank
Blank

Adnan

In B1 I want 2 as there are two blanks b/w Kamran and Mumtaz, in B4, 3 and B9, 5...

Hope it makes sense!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
In B1 copied down

=IFERROR(IF(ISBLANK(A1),"",MATCH("*",A2:A$65000,0)-1),"")

The last cell in lookup range must lie below the last row containing data
- allow lots of spare rows for new data
 
Last edited:
Upvote 0
Hi Yongle, thanks for your quick response, There is one more condition that I should have mentioned in the above question, there is another column based on that it should count blanks, here is a sample data for your ease - below;

Here is my Previous data

Kamran
Blank
Blank
Blank
Blank
Mumtaz
Blank
Blank
AhmedBlank
Blank
Blank
Blank
Blank
Blank
Adnan

In column A I have items and In B, I have a list of Sub items, next to every blank cell of column a there is a sub item name in B, I want to count sub items b/w two item...

Kamran has 4 Sub items,
Mumtaz has 2 sub items and so on...
 
Upvote 0

Forum statistics

Threads
1,223,912
Messages
6,175,340
Members
452,638
Latest member
Oluwabukunmi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top