+ Reply to Thread
Results 1 to 38 of 38

Calculating Operational Downtime

  1. #1
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Calculating Operational Downtime

    I cannot figure out how to calculate the operational downtime via formula. Attached I have a sample of what I am trying to figure out. We occasionally have a machine go down on lets say 01APR at 03:15 then we fix it on 03APR 19:37. I need a formula to figure out both How many minutes the machine is down in total and a separate formula to figure out how many minutes of operational time we missed. Please help I cannot wrap my head around this.
    Attached Files Attached Files
    Last edited by mononine; 05-08-2019 at 05:32 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Calculating Operational Downtime

    Do you ever have down time start outside of your operational hours? If you don't, these formulas might do the trick.

    For total downtime, in H2 and drag down:
    Please Login or Register  to view this content.
    For operational downtime, in J2 and drag down:
    Please Login or Register  to view this content.
    Use those results divided by 60 to get the hours. Hopefully that gives you what you're looking for.
    Last edited by Melvosh; 05-06-2019 at 05:18 PM. Reason: added solution
    If someone helped achieve your solution, consider clicking "* Add Reputation" on their post.

    If your question has been answered, mark the thread as [SOLVED] using the Thread Tools menu at the top of the thread.

  3. #3
    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: Calculating Operational Downtime

    Hi and welcome to the forum,

    Perhaps in G2 copied down

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This will give you the hours and decimals of an hour for downtime.
    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.

  4. #4
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    Quote Originally Posted by Melvosh View Post
    Do you ever have down time start outside of your operational hours? If you don't, these formulas might do the trick.

    For total downtime, in H2 and drag down:
    Please Login or Register  to view this content.
    For operational downtime, in J2 and drag down:
    Please Login or Register  to view this content.
    Use those results divided by 60 to get the hours. Hopefully that gives you what you're looking for.

    This worked wonderfully. I did have to change the cells in the second formula to reflect mine on sheet. But spot on work.

    Now the give a fish feed for the day, teach to fish feed for lifetime question. Could you possibly explain what all this formula means? I'm familiar with if statements and basic math formulas. However these formulas look like a foreign language to me. I would like to understand how this works. If it is to much to ask please just tell me. I will understand.

    Thank you so much for the help.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,448

    Re: Calculating Operational Downtime

    Firstly:

    =((E2+F2)-(C2+D2))*1440

    Subtract the sum of C2 and D2 from the sum of E2 and F2, then multiply the result by 1440. This turns the answer into minutes.

    Secondly:

    =(IF(F2<=A2,(E2-1)+B2,IF(F2>=B2,E2+B2,E2+F2))-(C2+D2))*1440

    If F2 is less than or equal to A2, subtract 1 from E2 and then add this to B2 then subtract the sum of C2 and D2 and multiply the result by 1440.

    If F2 is bigger than or equal to B2, add E2 and B2 then subtract the sum of C2 and D2 and multiply the result by 1440.

    If neither of the first to criteria are met, add E2 and F2 then subtract the sum of C2 and D2 and multiply the result by 1440.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    That is crazy how your mind works to understand this. Thank you so much. Now to study what you just explained.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,448

    Re: Calculating Operational Downtime

    No, not crazy - just very logical. That's all it is - logic: if this, then this; if that, then that; if neither of the above, the other.

  8. #8
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    Quote Originally Posted by AliGW View Post
    No, not crazy - just very logical. That's all it is - logic: if this, then this; if that, then that; if neither of the above, the other.
    May I ask 1 last question of the group. In the second formula how would I add an additional statement telling it only to complete the formula if for hypothetical speak Z2=DOG

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,448

    Re: Calculating Operational Downtime

    Try this:

    =IF(Z2<>"Dog","",(IF(F2<=A2,(E2-1)+B2,IF(F2>=B2,E2+B2,E2+F2))-(C2+D2))*1440)

  10. #10
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    You're so fast. Incredible.

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,448

    Re: Calculating Operational Downtime

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  12. #12
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    I believe it does. I might be able to figure out from your explanations on how to make the formula change based on is Z2 Cat or Dog. Thank you so much

  13. #13
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Calculating Operational Downtime

    To add to Ali's explanation, the logic in the second formula is there to account for fixes outside of working hours. If the fix time is between midnight and open, only count the hours to the end of the previous day. If the fix time is between close and midnight, only count the hours to the end of the current day. If neither is true, count the total time.

  14. #14
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    Alright,

    I will admit fault. I felt more confident than I should have. So I have updated the attached file to reflect the exact sheet I am trying to work on.
    As discussed above we figured out how to calculate the total downtime. The problem lies with all the additional statements of the actual sheet for factoring in the hours the facility is closed. So I will be as specific this time as humanly possible.

    In Column K. I need to calculate the operational downtime in minutes minus facility closed time. Only for any faults that have a status in Column A that = P1. However there is 3 separate facilities with 3 separate hours of operation in Columns N,O,P. The final wrench in my IF,IF,IF,IF,IF,IF equation is that the operational downtime for a P1 stops counting in a possibility of 2 separate ways. Which are the Status Changes to =P2 in Column E with Date and Time in F and G, OR it can change when then work order is closed as in Columns H and I.

    I far far far overestimated what I thought I understood from the previous advice given. Is this even possible?

  15. #15
    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: Calculating Operational Downtime

    Hi,

    It's extremely important that we are able to check any solutions we come up with.

    That necessitates you first manually calculating and adding the results you expect. Clearly identify which columns are data and which are results, and if it's not blindingly obvious explai your workings in a note that references specific cells.

    Please add the results and reupload

  16. #16
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Calculating Operational Downtime

    I second Richard's request for expected results. I also have a couple more questions. Can any of the Open Times or Change Times be outside of normal operating hours? I would guess no, but I may be wrong (I often am). Also, what happens when the Close Time / Date are before the Change Time / Date? Which time / date should be used to calculate hours?

  17. #17
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    It's extremely important that we are able to check any solutions we come up with.

    That necessitates you first manually calculating and adding the results you expect. Clearly identify which columns are data and which are results, and if it's not blindingly obvious explai your workings in a note that references specific cells.

    Please add the results and reupload
    Richard I have updated the spreadsheet to what I hope makes it crystal clear.

  18. #18
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Calculating Operational Downtime

    Try this formula, based on the data provided. It does not account for any start / change / close times outside of normal working hours. If those need to be accounted for, let us know which times might fall outside normal working hours. It also requires a helper formula.

    Helper formula in O1, copied and pasted into O4 and O7 (make sure the references adjust):
    Please Login or Register  to view this content.
    Downtime calculation formula in K2 and dragged down:
    Please Login or Register  to view this content.
    This matches the results provided (or should). If any adjustments need to be made, let us know.
    Last edited by Melvosh; 05-07-2019 at 03:03 PM. Reason: changed helper formula

  19. #19
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    Quote Originally Posted by Melvosh View Post
    Try this formula, based on the data provided. It does not account for any start / change / close times outside of normal working hours. If those need to be accounted for, let us know which times might fall outside normal working hours. It also requires a helper formula.

    Helper formula in O1, copied and pasted into O4 and O7 (make sure the references adjust):
    Please Login or Register  to view this content.
    Downtime calculation formula in K2 and dragged down:
    Please Login or Register  to view this content.
    This matches the results provided (or should). If any adjustments need to be made, let us know.

    I think we are making progress. This formula looks far more complicated than anything I could ever think of. I only notice things that don't work. Other than it these formulas are perfect and you are a god of excel.

    When Column A has P2 in it Column K should not reflect anything, it should remain blank.

  20. #20
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Calculating Operational Downtime

    Here's an updated formula so P2 results in blank:
    Please Login or Register  to view this content.
    There are others here far more talented than me. I just stumble on through as best as I can

  21. #21
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    Problem solved. This is by far the most supportive site I have ever found. Thank you.

  22. #22
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Calculating Operational Downtime

    Happy to help, and thanks for the rep!

  23. #23
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    I hate to open this back up again. I have attached the final worksheet. The formula appears to work in some locations and not in others. A ton of "value" and "false" blocks. Can someone take a look at what might be causing the issue. The manual work is in Yellow and the formula work is in Orange.

  24. #24
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    All 0 sums should be blank as Row 2 is correct.
    Last edited by AliGW; 05-08-2019 at 08:24 AM.

  25. #25
    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: Calculating Operational Downtime

    Picking up your comments in #15 can we go back to basics.
    Would you confirm the following

    As I understand it the object is to determine the number of minutes between the time a task is said to be started and the time it's closed.

    1. The time the task is started is EITHER Columns D&E UNLESS there's a date/time in columns (N&O) in which case N&O are used
    The time the task is closed is Columns R&S

    2. Once the difference between the times in 1 above is evaluated this is modified by deciding whether the start or end times are outside the hours of operation of a particular airport, and if that is the case reducing the number calculated in 1 above accordingly - taking into account if more than one day is involved the modification needs to reflect this.

    Are there any other modifications? I see reference to P1 & P2 but if I understand it that is essentially the calculation in 1 above

  26. #26
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    1. The time the task is started is ALWAYS Columns D&E.

    2. The task closed date / time in Columns R&S are the final close out. The calculation for this difference is reflected in Columns X/Y

    3. The Columns U&W are the reflection of the calculation of the difference in Open (D&E ) & Close (R&S) OR Open (D&E) & Change (N&O). Only IF Column B = P1.

    4. If Column B = P2 then Columns U&W shall remain Blank.

    I hope this helps clarify. I think you understand what I'm thinking.
    Last edited by AliGW; 05-08-2019 at 08:24 AM.

  27. #27
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,448

    Re: Calculating Operational Downtime

    Please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.

  28. #28
    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: Calculating Operational Downtime

    Please check the attached out.

    It uses the following formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I think perhaps the only modification required is to trap an event like row 10 where the finish Date/Time is EARLIER than the Start date/Time

    The only other mod that might be necessary is where more than one day is involved and the start or end times are within the hours of operation.
    At the moment an adjustment is made for the whole of the hours of operation for each day of the subsequent days if relevant. I've not checked it out yet but I think it needs an adjustment where this is the case
    Attached Files Attached Files

  29. #29
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    Richard I think we went down different rabbit holes on that one.

    I think to simplify might be to ask why is line 27 working correct calculating how long in P1 before it Changed to P2. But line 26 is showing "false" for calculating the difference between Open and Closed. I think something wrong in this section of the formula.

  30. #30
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    If you take a gander at Sheet 1 in that spreadsheet. Everything works as it should. But when I copy the formula over into Ticket Summary (2) the formula starts giving errors. That is what doesn't make sense to me. Why does it work on one page but not on another?

  31. #31
    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: Calculating Operational Downtime

    Sorry you've lost me

    My formula is not showing False, it's showing 100 minutes, i.e the difference between 18:21 and 20:01
    You are showing 39 in V26. How do you calculate that?

    As I mentioned I think a Mod is still required for a start/finish time outside the hours of operation. I think this is a case in point since the finish time is 20:01, i.e. i minute past the hours of operation which finished at 20:00. Should the actual result be 99 minutes not 100?

  32. #32
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    Richard

    If you open the spreadsheet. Please check out "Sheet 1" if you play with it you'll notice all formulas are working on it perfectly. However when I copy the formula to "Ticket Summary" it does not work. I tried to move the data from "ticket Summary" to "Sheet 1" that doesn't work either. I don't understand.

    Attachment 623465

  33. #33
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Calculating Operational Downtime

    The reason the formula is returning FALSE on Ticket Summary is because there is a scenario there that wasn't represented in the previous workbook, namely P1 being in both the initial priority and the interim priority. I did not account for that in the formula. Does the Ticket Summary sheet have all of the possibilities that need to be accounted for?

    Edit: The reason there are #VALUE! errors is due to the Times not all being actual times, but some being text.
    Last edited by Melvosh; 05-08-2019 at 11:40 AM.

  34. #34
    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: Calculating Operational Downtime

    Back to Basics

    Which sheet are you trying to get results for? Sheet1 or the Tickets SUmmary (2) sheet?

    Your post #23 said "The manual work is in Yellow and the formula work is in Orange." I took that to mean Ticket Summary (2)
    And I also took from that, that the results you WANTED was the orange column O, but there were FALSE values occurring which you needed correctingso that they produced a numeric result - which was waht my simplified formula is doing.

    As with all these things we need a definitive set of results that you've manually created, and an understanding of the rules you apply. I think I understand the rules you want to apply - what I'm not clear on is what are the ACTUAL results you want for ALL the records.

  35. #35
    Registered User
    Join Date
    05-06-2019
    Location
    America
    MS-Off Ver
    2018
    Posts
    17

    Re: Calculating Operational Downtime

    I believe it may be simple formatting error.

    Sheet 1 and Ticket Summary are identical in the fields and formulas. Sheet 1 was the original sheet that the wonderful members of this group provided. When I manually input data into the cells on Sheet 1 everything works perfectly. No "false" or "value". I then attempted to place those formulas into the actual worksheet which is Ticket Summary. I got a ton of errors. You then provided the simplified numbers on the side but those numbers did not reflect the numbers factoring in all conditions. So I could not use. So then I attempted to copy and past the data from Ticket Summary into Sheet 1 which was working with manual input. This resulted in the same errors as on Ticket Summary.

    So I recently while waiting for assistance have manually input 5 of the rows that were errors on Ticket Summary into Sheet 1. They work wonderfully but I had to manually type each letter and number. So I am thinking there is a formatting issue causing the formula to not work. What do you think?

  36. #36
    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: Calculating Operational Downtime

    As I said I want to see a definitive set of ALL the results you expect in order that any solution can be tested.
    And I'm assuming that the Production worksheet you want to use is the Ticket Summary sheet - but if not say so, there's no point in working on a sheet that you won't be using in anger.

    Does column W, specifically W2:W115 contain all the results you expect? I sense not since it contains FALSE values and errors.
    Or is it column V?

    However If you will manually add ALL the results you expect and indicate which column contains the results maybe we can move forward.

    The formula I came up with was simpler than the one you were using and in most cases came up with the same answer, and gave values where you were getting FALSE.

  37. #37
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Calculating Operational Downtime

    One thing I've noticed on the spreadsheet currently uploaded in post #1 is that on the Ticket Summary sheet, there are a number of cells that have "P1 " (extra space), meaning the formula is returning FALSE when comparing "P1" to "P1 ". I've added TRIM functions, and I'm now treating P1 in column M on Ticket Summary the same as if column M is blank.
    Please Login or Register  to view this content.
    There are still some anomalies here and there. There are a few manually calculated numbers that do not appear correct. There are a few airport codes with no hours specified. There are a few rows where interim priority is N/A. Try out the formula in column W in Ticket Summary, and then let us know how you'd like the various anomalies handled.

  38. #38
    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: Calculating Operational Downtime

    ...So are you needing any further assistance???

    If so please upload the workbook with the Results you expect fully detailed as per my last post.

+ 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] Calculating Hours of Downtime Every Month
    By Thienzaw in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-21-2019, 09:15 AM
  2. [SOLVED] Calculating Downtime During Hours of Operation
    By Puni in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-01-2018, 11:00 PM
  3. Replies: 3
    Last Post: 08-18-2017, 12:00 PM
  4. Calculating Downtime taking into acount 3 possible shifts of production.
    By Clintp1111 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-12-2013, 12:16 AM
  5. Need help calculating Downtime
    By Ben.Cgg in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-29-2013, 05:02 PM
  6. Need help in calculating downtime
    By Nitinkumar in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-06-2013, 09:58 AM
  7. An Operational Problem
    By PA in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 07-18-2006, 04:40 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