Count empty blank cells betwen numbers - Help Please

shaunkaz

Board Regular
Joined
Jan 30, 2008
Messages
204
Hi Can someone please help me.. I have been asked to create a spreadsheet and part of it counts the number of empty cells between the numbers.. Example below

On the first row these numbers are copied in from another sheet then row 4 is where I need the formula. There are many columns so once I have the formula then I can drag across but it gives you he idea of what I want

Thanks
Shaun
1251
213

<TBODY>
</TBODY>
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
dont know why but it doesnt show the table.. the 2 under the 2 means there are 2 empty blank cells the the left of the top 2, 1 empty cell to the left of number 5 and 3 empty cells to the left of number 1.

Thanks
Shaun
 
Upvote 0
Perhaps like this :)


Excel 2010
ABCDEFGHIJ
11251
2 213
Sheet1
Cell Formulas
RangeFormula
B2=IF(B1="", "", COUNTBLANK($A$1:B1)-SUM($A$2:A2))


/AJ
 
Upvote 0
Hi to try this I copied your table and it worked when I tried to on my sheet because and have my B row further down how can I modify this formula to work.. I tried =if(E150="",,COUNTBLANK($E$5,E150)-SUM($E$5:E5)) but wont work as you see my information is on row 5 but formula is on row 150

Thanks
Shaun
 
Upvote 0
Basically the COUNTBLANK reference should refer to the Row where the blanks you wish to count are. The first reference (with the $ signs) is where on that row you wish to start counting, and the second part, after a colon not a comma, is the next cell along (to start with), which will change as you drag along.

The SUM reference should refer to the row where you're inputting the formula and the first reference, with $ signs should be the first cell on that row (which you would leave blank) and the next reference, after the colon, is the same cell.

/AJ
 
Upvote 0
I have now been asked to slight modify the formula.. I need to add 1 (+1) to each of the answers above. Can someone please tell me how this can be done..

Thanks
Shaun
 
Upvote 0
Sure. To edit my formula above it would become...
Rich (BB code):
=IF(B1="", "", COUNTBLANK($A$1:B1)-SUM($A$2:A2)+1)

The filled to the left. Change the references to suit :)

/AJ
 
Upvote 0
Hi Adam

Thanks for your reply, it work on the first number but not the rest.. Am I doing something wrong

Thanks
Shaun
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,585
Members
448,972
Latest member
Shantanu2024

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