+ Reply to Thread
Results 1 to 7 of 7

Calculate number of consecutive occurances over 14

  1. #1
    Registered User
    Join Date
    06-08-2021
    Location
    London, England
    MS-Off Ver
    365
    Posts
    6

    Exclamation Calculate number of consecutive occurances over 14

    Hi all,

    Trying to sort some data in a spreadsheet...

    We have a table that shows annual leave and I need to find any rows that contain more than 14 consecutive number 1s to signify more than 14 days off in a row.

    The sheet is attached, 0 means no leave taken, 1 means a day taken

    Any help would be MASSIVELY appreciated
    Attached Files Attached Files

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,655

    Re: Calculate number of consecutive occurances over 14

    CF in B2:

    =AND(B2=1,SUMIF($B$1:B$1,">="&B$1-14,$B2:B2)>13)
    Attached Files Attached Files
    Quang PT

  3. #3
    Registered User
    Join Date
    06-08-2021
    Location
    London, England
    MS-Off Ver
    365
    Posts
    6

    Re: Calculate number of consecutive occurances over 14

    Hi,

    It comes up with False? Even when I know the row has met the criteria.
    Last edited by GeorgeBarber; 06-08-2021 at 07:32 AM.

  4. #4
    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. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,933

    Re: Calculate number of consecutive occurances over 14

    Provide a sample file demonstrating the problem.
    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.

  5. #5
    Registered User
    Join Date
    06-08-2021
    Location
    London, England
    MS-Off Ver
    365
    Posts
    6

    Re: Calculate number of consecutive occurances over 14

    Quote Originally Posted by AliGW View Post
    Provide a sample file demonstrating the problem.
    Attached is the sample file with the formula in
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,980

    Re: Calculate number of consecutive occurances over 14

    Bebo's formula is meant to be used as a conditional formatting rule as illustrated in the file attached to post #2.
    In the file attached to post #5 the formula has been placed into cell B2 instead, which is causing a circular referenced error.
    Please tell us if the conditional formatting in the file attached to post #2 is not what you want, and why.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    06-08-2021
    Location
    London, England
    MS-Off Ver
    365
    Posts
    6

    Re: Calculate number of consecutive occurances over 14

    Hi All,

    I have now sorted through the data manually, so thank you all for your help anyway.

    I was trying to find a way to indicate in one column whether that sequence came up, so it would be easier to sift the data.

+ 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. [SOLVED] How to count consecutive occurances of values greater than 0?
    By lhorner in forum Excel General
    Replies: 7
    Last Post: 05-01-2021, 11:03 AM
  2. Separately counting occurances of consecutive values of the same name
    By Hinchliffe2012 in forum Excel Formulas & Functions
    Replies: 27
    Last Post: 08-13-2018, 04:55 AM
  3. [SOLVED] UDF to Find Consecutive X Occurances of Y
    By Portland in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-08-2017, 10:33 AM
  4. Calculate the number of consecutive results
    By Panifran in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-08-2016, 03:07 PM
  5. Counting the number of occurances with consecutive values above zero
    By bryan3228 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-13-2015, 09:35 AM
  6. Replies: 2
    Last Post: 10-04-2012, 06:35 AM
  7. can i calculate the number of occurances of a partucular value?
    By sruth in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-19-2006, 03:35 AM

Tags for this Thread

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