+ Reply to Thread
Results 1 to 10 of 10

(Solved) sum maximum consecutive 1 value in a calendar row

Hybrid View

WenPeters (Solved) sum maximum... 02-06-2023, 05:30 AM
avk Re: sum maximum consecutive 1... 02-06-2023, 06:12 AM
WenPeters Re: sum maximum consecutive 1... 02-06-2023, 06:35 PM
avk Re: sum maximum consecutive 1... 02-07-2023, 02:56 AM
WenPeters Re: sum maximum consecutive 1... 02-07-2023, 03:36 AM
CARACALLA Re: sum maximum consecutive 1... 02-07-2023, 05:43 AM
avk Re: sum maximum consecutive 1... 02-07-2023, 06:21 AM
Gregb11 Re: sum maximum consecutive 1... 02-07-2023, 06:28 AM
WenPeters Re: sum maximum consecutive 1... 02-07-2023, 08:20 PM
Gregb11 Re: sum maximum consecutive 1... 02-07-2023, 08:59 PM
  1. #1
    Registered User
    Join Date
    02-06-2023
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    4

    Post (Solved) sum maximum consecutive 1 value in a calendar row

    Hi,

    I've created a calendar that puts a value of 1 if an employee has leave on that day. If they don't, it has a value of 0 in that day. I'm trying to find a formula that will return the maximum sum of consecutive 1's in that calendar row for the employee. For example, over a two year period, I want to return the highest continuos period on leave for that period.

    Regards
    Wen
    Last edited by WenPeters; 02-09-2023 at 10:46 PM.

  2. #2
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,277

    Re: sum maximum consecutive 1 value in a calendar row

    If your data in column
    Formula: copy to clipboard
    =MAX(FREQUENCY(IF($A$2:$S$2>0,COLUMN($A$2:$S$2)),IF($A$2:$S$2<=0,COLUMN($A$2:$S$2))))


    If in row
    Formula: copy to clipboard
    =MAX(FREQUENCY(IF(A2:A20>0,ROW(A2:A20)),IF(A2:A20<=0,ROW(A2:A20))))

    one time pressing shift+ctrl+enter


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  3. #3
    Registered User
    Join Date
    02-06-2023
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    4

    Re: sum maximum consecutive 1 value in a calendar row

    Hi avk, thanks for the quick response. I have tried that, but it seems to be just returning the sum of the row. I've attached a sample, fyi. Thanks again Wen

    Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat
    MP Employee ID 01-Dec 02-Dec 03-Dec 04-Dec 05-Dec 06-Dec 07-Dec 08-Dec 09-Dec 10-Dec 11-Dec 12-Dec 13-Dec 14-Dec 15-Dec 16-Dec 17-Dec 18-Dec 19-Dec 20-Dec 21-Dec 22-Dec 23-Dec 24-Dec 25-Dec 26-Dec 27-Dec 28-Dec 29-Dec 30-Dec 31-Dec Max consecutive Should be
    00000001 1 0 0 0 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 0 0 0 0 1 1 1 0 13 5
    00000002 0 1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 7 3
    00000003 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 5 3
    00000004 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 6 2
    00000006 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 1 1 1 13 7

  4. #4
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,277

    Re: sum maximum consecutive 1 value in a calendar row

    Its better to attach sample file with original data with required output.

  5. #5
    Registered User
    Join Date
    02-06-2023
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    4

    Re: sum maximum consecutive 1 value in a calendar row

    Hi avk, please find attachment. Thanks
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,986

    Re: sum maximum consecutive 1 value in a calendar row

    ABD3=MAX(FREQUENCY(IF(B3:ABC3=1,COLUMN(B3:ABC3)),IF(B3:ABC3<>1,COLUMN(B3:ABC3))))

    for office 365 enter

    for other office control+shift+enter

    copy down

  7. #7
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,277

    Re: sum maximum consecutive 1 value in a calendar row

    Formula: copy to clipboard
    =MAX(FREQUENCY(IF(B3:ABC3>0,COLUMN(B3:ABC3)),IF(B3:ABC3<=0,COLUMN(B3:ABC3))))

    By pressing one time shift+ctrl+enter
    Since asking maximum consecutive 1 value

  8. #8
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,180

    Re: sum maximum consecutive 1 value in a calendar row

    with 365, another option:

    =MAX(LEN(TEXTSPLIT(TEXTJOIN("",TRUE,B3:ABC3),0)))

  9. #9
    Registered User
    Join Date
    02-06-2023
    Location
    Melbourne, Australia
    MS-Off Ver
    365
    Posts
    4

    Re: sum maximum consecutive 1 value in a calendar row

    Thankyou avk, Caracall and Gregb11 - much appreciated

  10. #10
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,180

    Re: sum maximum consecutive 1 value in a calendar row

    You're welcome, and thanks for the rep!

+ 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] Maximum consecutive columns with value equal or above 2
    By Teddy Tash in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-24-2016, 02:09 PM
  2. Consecutive 5 Maximum number in a column
    By ssb648 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2016, 03:12 AM
  3. Counting Maximum Consecutive Days
    By Delleeb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-26-2013, 03:51 PM
  4. Maximum value in consecutive numbers separated by 0
    By so1989 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-08-2012, 10:05 AM
  5. [SOLVED] count the maximum number consecutive
    By Berna11 in forum Excel General
    Replies: 9
    Last Post: 07-13-2012, 11:27 AM
  6. Maximum Consecutive Drawndown formula
    By asaini009 in forum Excel General
    Replies: 6
    Last Post: 02-06-2012, 05:24 PM
  7. Calculating value for maximum consecutive value
    By than_k22 in forum Excel General
    Replies: 7
    Last Post: 10-15-2010, 01:08 PM

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