Counting cells with number

Keala

New Member
Joined
Jul 9, 2018
Messages
37
I have issue in count cells which I hope you can suggest a solution for.

I have column with a mix of 0s and value >0. So I need to count number of zeros in between each number>0 and state it on the next column.
It looks like this and what I want to achieve:
1
0
0
0
0
12 count= 4
0
0
0
3 count=3
0
0
0
0
0
0
55 count=6
...

The number of zeros is different all the time, sometimes it is only 3 zeros then a number or sometime it is 55 zeros then a number. I could do this manually with count function but since it is more then 300000 rows it will be quite demanding.

All suggestions are appreciated, maybe a macro is not neccessary and a work sheet solution would do it?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Yes but with some modification. Following code work for me:
[/code]
=SUM(A1:A3)
=COUNTIF(A1:A3;">"&1)
the , is replaced with ;
but the same change in the original code will only give a green arrow at left upper corner on the cell.
 
Upvote 0
Thank you for your help and suggestion, now for a unclear reason it works now! (Which is the main thing.)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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