+ Reply to Thread
Results 1 to 9 of 9

Consecutive status in period of 15 minutes

  1. #1
    Registered User
    Join Date
    01-27-2012
    Location
    Serbia
    MS-Off Ver
    Excel 2010
    Posts
    19

    Question Consecutive status in period of 15 minutes

    Hi can someone help me create macro which will go on all sheets in workbook and searche for consecutive "Failed Status" within the period of 15 minutes and highlight them. Here is the example

    time status
    03.11.2015 07:15 Failed
    03.11.2015 07:17 Failed
    03.11.2015 07:19 Failed
    03.11.2015 07:28 Failed
    03.11.2015 07:32 Successful
    03.11.2015 07:38 Failed


    the first 4 rows have consecutive "Failed" status in period of 15 min and they should be highlighted.

    I found some code that can be used but i need to change it.
    Please Login or Register  to view this content.
    here the problem here is that it should first find "Status" column and check consecutive values there and that see if its in a time of 15 min.

    Thank you
    Last edited by steve87bg; 11-05-2015 at 04:44 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Consecutive status in period of 15 minutes

    On the face of it you seem to be overcomplicating it.

    Your code suggests that the words 'Failed' or 'Succesful' are already present in column B. I which case why not just use Conditional Formatting to detect the word 'Failed' and paint/highlight evey cell which meets the condition?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-27-2012
    Location
    Serbia
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Consecutive status in period of 15 minutes

    Hi Richard, the problem here is that it needs to check more than 3 Consecutive Failed statuses and check if they are in period of 15 min. Simple Conditional Formatting will not work here.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Consecutive status in period of 15 minutes

    Would you upload a workbook and manually add the colouring you expect to see. We can then be certain what you want. Would you also confirm that the date/time column is a real date number and not merely text. i.e. when you use =ISNUMBER(A1) does it return the value TRUE

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Consecutive status in period of 15 minutes

    ...and do you mean that the 3 successive Failed test starts afresh after a Successful result?

  6. #6
    Registered User
    Join Date
    01-27-2012
    Location
    Serbia
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Consecutive status in period of 15 minutes

    Here is the workbook with 3 sheet. On all sheets is highlighted everything that macro should be doing. To find more that 3 Consecutive "Failed" statuses and that that "Failed" statuses are in period of 15 min

    ConsecutiveStatus.xlsx
    Last edited by steve87bg; 11-05-2015 at 05:03 PM.

  7. #7
    Registered User
    Join Date
    01-27-2012
    Location
    Serbia
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Consecutive status in period of 15 minutes

    is there any way that it omehow count the difference in "Failed" status range between first and last date in that range?

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Consecutive status in period of 15 minutes

    I can't see an example of a Failed which is more than 15 minutes from the previous failed and which I'm guessing should not be coloured.
    For instance suppose A24 had been timed 09:20 would that be blank?

    Are all times supposed to be incremental and A25:A27 are typos and should be 09:mm?

  9. #9
    Registered User
    Join Date
    01-27-2012
    Location
    Serbia
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Consecutive status in period of 15 minutes

    Hi Richard. I just realize that it would be better just to highlight all consecutive Failed status no mater if they belong to period of 15 min or not. I think that this will make things easier. If there are more than 3 consecutive Failed status highlight entire row.

    This have to be done on all sheets and it should first look for "status" column and check if there is a consecutive Failed there

+ 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: 3
    Last Post: 09-11-2014, 04:32 PM
  2. Replies: 17
    Last Post: 06-09-2013, 01:06 AM
  3. Replies: 8
    Last Post: 12-13-2012, 01:15 PM
  4. Replies: 4
    Last Post: 04-08-2012, 09:43 PM
  5. Calculating the minutes for a period during a time frame
    By aquajock98 in forum Excel General
    Replies: 0
    Last Post: 07-29-2011, 06:55 PM
  6. compare related, consecutive rows, looking for a final status
    By keelert in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-11-2010, 01:48 PM
  7. Replies: 1
    Last Post: 06-01-2006, 01:15 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