+ Reply to Thread
Results 1 to 12 of 12

How to count number of consecutive days

  1. #1
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    258

    How to count number of consecutive days

    Hi all,

    I would like to ask, whether here is somebody who could help me to solve my issue :-)

    I have a list of data ==> Date, Server and Status of the server.

    What I want is to have number of servers failing less than 2 times in a row, thanks 2 - 3 times and more than 3 times.

    Not sure exactly how to do it hence I'm attaching the example

    Thanks,
    Attached Files Attached Files

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to count number of consecutive days

    Try these array formulas**:

    < 2 times in a row, entered in G2:

    =SUM(IF(FREQUENCY(IF(C2:C50="Failed",ROW(C2:C50)),IF(C2:C50<>"Failed",ROW(C2:C50)))=1,1))

    > 3 times in a row, entered in G4:

    =SUM(IF(FREQUENCY(IF(C2:C50="Failed",ROW(C2:C50)),IF(C2:C50<>"Failed",ROW(C2:C50)))>3,1))

    2 - 3 times in a row, entered in G3:

    =SUM(IF(FREQUENCY(IF(C2:C50="Failed",ROW(C2:C50)),IF(C2:C50<>"Failed",ROW(C2:C50))),1))-G2-G4

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    258

    Re: How to count number of consecutive days

    Can I use SUMIF, if I need to add 1 or 2 conditions?

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to count number of consecutive days

    Quote Originally Posted by dobracik View Post
    Can I use SUMIF, if I need to add 1 or 2 conditions?
    No, SUMIF will not work for this.

  5. #5
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    258

    Re: How to count number of consecutive days

    Actually is not, what I was looking for
    I need to see in number of failing servers in a row ( like consecutive) .

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to count number of consecutive days

    The formulas I suggested DO WHAT YOU ASKED FOR.

    If that's not what you wanted then explain what you do want and update the sample file to show what results you expect.

  7. #7
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    258

    Re: How to count number of consecutive days

    Well, I was not rude, hence would like to avoid capitals.
    I've tested even your suggestion and when sorted based on column C, numbers are shows only for more that 3 times, where's number 1, which is not correct.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to count number of consecutive days

    Don't understand what you mean when you say: "when sorted based on column C".

    Column C contains only 2 different entries, Passed or Failed.

    So, if you "sort" column C on Failed then this is what you end up with:

    Data Range
    A
    B
    C
    1
    Date
    Server
    Status
    3
    8/4/2016
    Server 1
    Failed
    4
    8/4/2016
    Server 1
    Failed
    7
    8/4/2016
    Server 1
    Failed
    10
    8/4/2016
    Server 1
    Failed
    17
    8/4/2016
    Server 1
    Failed
    18
    8/4/2016
    Server 1
    Failed
    29
    8/4/2016
    Server 4
    Failed
    30
    8/4/2016
    Server 4
    Failed
    31
    8/4/2016
    Server 4
    Failed
    32
    8/4/2016
    Server 4
    Failed
    37
    8/4/2016
    Server 5
    Failed
    38
    8/4/2016
    Server 6
    Failed
    39
    8/4/2016
    Server 6
    Failed
    40
    8/4/2016
    Server 6
    Failed
    49
    8/4/2016
    Server 7
    Failed
    50
    8/4/2016
    Server 8
    Failed


    What result do you expect for that data?

  9. #9
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    258

    Re: How to count number of consecutive days

    Hi,

    I just wanted to say, that when I sorted based on column C, got number 1, which is weird for me. :-)
    What I need is to see:
    • Number of Servers that failed less than 2 consecutive days
    • Number of Servers that failed 2 to 3 consecutive days
    • Number of Servers that failed more than 3 times consecutive days

    I've modified a bit the attached file, please find below.

    Thank you a lot,
    Andy
    Attached Files Attached Files

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to count number of consecutive days

    Update the file and show us what results you expect.

  11. #11
    Forum Contributor
    Join Date
    11-04-2012
    Location
    Czech Republic
    MS-Off Ver
    MS 365
    Posts
    258

    Re: How to count number of consecutive days

    Ok, please find attached. I've tried to modify it, not sure, whether this would help.

    The results of this should be summary of how many servers are failing in 2, 3 or mor than 3 consecutive days

    Andy
    Attached Files Attached Files

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How to count number of consecutive days

    Sorry, but I don't understand how you arrive at those results.

+ 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. Count number of consecutive days by date
    By malek_ali7sas in forum Excel General
    Replies: 11
    Last Post: 02-21-2016, 10:17 AM
  2. Count number of consecutive days and max streak
    By caubetiep1337 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2016, 03:53 AM
  3. Replies: 17
    Last Post: 08-03-2015, 06:15 AM
  4. [SOLVED] Count number of consecutive days and instances
    By Cortlyn in forum Excel General
    Replies: 7
    Last Post: 02-06-2015, 06:02 PM
  5. [SOLVED] Count Consecutive Days Based on Unique Number
    By Kimston in forum Excel General
    Replies: 5
    Last Post: 11-23-2014, 04:46 PM
  6. Replies: 2
    Last Post: 07-25-2013, 01:01 PM
  7. Replies: 2
    Last Post: 11-05-2011, 07:29 AM

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