+ Reply to Thread
Results 1 to 10 of 10

Formula to count how many times does a 0 repeat in a column of 1 and 0

  1. #1
    Registered User
    Join Date
    05-14-2016
    Location
    Croatia
    MS-Off Ver
    2013
    Posts
    13

    Post Formula to count how many times does a 0 repeat in a column of 1 and 0

    So, I have a lot of columns with 1 and 0 on different frequencies I need a formula to count how many times does a 0 repeat in every column, for a better explanation look at the sample picture or the spreadsheet.
    Sample.png
    Sample.XLSX
    Thanks in advance.
    Last edited by MrW00dy; 05-15-2016 at 12:20 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,397

    Re: Need A Formula For This..

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,033

    Re: Formula to count how many times does a 0 repeat in a column of 1 and 0

    Will this output be OK for you?

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Never use Merged Cells in Excel

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,033

    Re: Formula to count how many times does a 0 repeat in a column of 1 and 0

    0's are position of first last or consecutive non-zeros (1 in this case).

    For example, array: 1,0,0,0,1,1,1,0,0,1 will result 0,3,0,0,2,0

  5. #5
    Registered User
    Join Date
    05-14-2016
    Location
    Croatia
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to count how many times does a 0 repeat in a column of 1 and 0

    Thanks a lot fellow Croatian :D

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,033

    Re: Formula to count how many times does a 0 repeat in a column of 1 and 0

    No problem

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,736

    Re: Formula to count how many times does a 0 repeat in a column of 1 and 0

    Please Login or Register  to view this content.
    =Zeros(range)
    Attached Files Attached Files

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,033

    Re: Formula to count how many times does a 0 repeat in a column of 1 and 0

    If you can transpose input data then output would look like:
    Attached Files Attached Files

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,736

    Re: Formula to count how many times does a 0 repeat in a column of 1 and 0

    See attached: macro version.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    05-14-2016
    Location
    Croatia
    MS-Off Ver
    2013
    Posts
    13

    Re: Formula to count how many times does a 0 repeat in a column of 1 and 0

    Tnx a lot man!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  2. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1