+ Reply to Thread
Results 1 to 5 of 5

Identify next match in column and execute basic arithmatic on rows in corresponding column

  1. #1
    Registered User
    Join Date
    08-14-2013
    Location
    Minneapolis
    MS-Off Ver
    Excel 2007
    Posts
    6

    Identify next match in column and execute basic arithmatic on rows in corresponding column

    I have a set of data showing system outages and am developing some metrics on these figures. One metric that I am working on is time between failure. What this means is how much time elapsed between two outages based on their start date/time. What is making this difficult is that three different types of outages exist(planned outage, down, degraded), and I only want to know the elapsed time between two of those (down & degraded). So in other words, I need a formula that ignores any records labeled as "planned outage". Below is an example of the data I am using. The numbers are all fictitious, so the example is very simplistic.

    begin end type
    7/30/2013 22:45 7/31/2013 0:20 Degradation
    7/29/2013 22:45 7/30/2013 0:20 Degradation
    7/28/2013 22:45 7/29/2013 0:20 Degradation
    7/27/2013 22:45 7/28/2013 0:20 Degradation
    7/26/2013 22:45 7/27/2013 0:20 Degradation
    7/25/2013 22:45 7/26/2013 0:20 Degradation
    7/24/2013 22:45 7/25/2013 0:20 Degradation
    7/23/2013 22:45 7/24/2013 0:20 Degradation
    7/22/2013 22:45 7/23/2013 0:20 Outage
    7/21/2013 22:45 7/22/2013 0:20 Planned Outage
    7/20/2013 22:45 7/21/2013 0:20 Degradation
    7/19/2013 22:45 7/20/2013 0:20 Planned Outage
    7/18/2013 22:45 7/19/2013 0:20 Outage
    7/17/2013 22:45 7/18/2013 0:20 Planned Outage
    7/16/2013 22:45 7/17/2013 0:20 Degradation
    7/15/2013 22:45 7/16/2013 0:20 Outage
    7/14/2013 22:45 7/15/2013 0:20 Planned Outage
    7/13/2013 22:45 7/14/2013 0:20 Planned Outage
    7/12/2013 22:45 7/13/2013 0:20 Outage

    I have created a nested if/then formula:

    =IF(AND(F2<>"Planned Outage",F3<>"Planned Outage"),D2-D3,IF(AND(F2<>"Planned Outage",F4<>"Planned Outage"),D2-D4,IF(AND(F2<>"Planned Outage",F5<>"Planned Outage"),D2-D5,IF(AND(F2<>"Planned Outage",F6<>"Planned Outage"),D2-D6,IF(AND(F2<>"Planned Outage",F7<>"Planned Outage"),D2-D7,IF(AND(F2<>"Planned Outage",F8<>"Planned Outage"),D2-D8,IF(AND(F2<>"Planned Outage",F9<>"Planned Outage"),D2-D9,"")))))))

    however, this formula is very clunky and also limited to 7 conditions, and there are instances where more than 7 "Planned Outages" occurr in a row. In those cases, the result is inaccurate and manual intervention is required. Having to apply this metric to hundreds of records on dozens of different tables makes that process very annoying. Any help would be greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Identify next match in column and execute basic arithmatic on rows in corresponding co

    You get better and quicker help if you follow the advice in the link below.

    http://www.excelforum.com/the-water-...-question.html
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    08-14-2013
    Location
    Minneapolis
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Identify next match in column and execute basic arithmatic on rows in corresponding co

    My apologies. Here is a sample file.
    Attached Files Attached Files

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Identify next match in column and execute basic arithmatic on rows in corresponding co

    Perhaps in C2 and copy down, this ARRAY formula.
    Please Login or Register  to view this content.


    -- Array(CSE) { }, formulae are confirmed with Control+Shift+Enter.
    Not just Enter.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  5. #5
    Registered User
    Join Date
    08-05-2013
    Location
    USA
    MS-Off Ver
    2010
    Posts
    76

    Re: Identify next match in column and execute basic arithmatic on rows in corresponding co

    See attached:

    Column D lists the <> Planned Outages in sequential order. Column E is just so that Column F doesn't try to search for a record before "1".

    Column F subtracts the End time of a record from the Begin Time of the previous record (record meaning #s in Column D). F is in the [h]:mm format - hours and minutes.
    Or you can erase the TRUE/FALSE column and use this formula instead: =IFERROR(IF(D2-1>0,SUMPRODUCT(($D$2:$D$20=D2-1)*($A$2:$A$20))-B2,""),"")


    *** Sorry... If you use this formula in the book, the results won't be "a row behind". =IF(MAX($D$2:$D$20)=D2,"",IFERROR(A2-SUMPRODUCT(($D$2:$D$20=D2+1)*($B$2:$B$20)),"")). I can reattach the workbook if you need.
    Attached Files Attached Files
    Last edited by jeffr27; 08-29-2013 at 04:49 PM.

+ 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. Identify cells that contain a match to a cell in another column
    By Calab in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-25-2013, 06:03 AM
  2. [SOLVED] drag down rows that match column in different sheet, but skip every 3 cells in column
    By mbkr29 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-23-2013, 01:43 PM
  3. How to identify/mark rows in a column that equals a sum..
    By Stealth1965 in forum Excel General
    Replies: 5
    Last Post: 08-24-2011, 04:14 PM
  4. Replies: 4
    Last Post: 04-09-2011, 02:51 PM
  5. Replies: 1
    Last Post: 08-21-2005, 07:05 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