+ Reply to Thread
Results 1 to 5 of 5

Calculate downtime while some time ranges are excluded

  1. #1
    Registered User
    Join Date
    10-05-2021
    Location
    Brussels
    MS-Off Ver
    Microsoft 365 for Entreprise
    Posts
    6

    Calculate downtime while some time ranges are excluded

    Hello everyone,

    I just created an account to ask for some help with an Excel sheet I am trying to prepare for work.
    We maintain trains in operation, and are penalised whenever we have to stop one for repairs; except when these repairs occur between midnight and 5AM (between 00h00 and 05h00).

    I've been trying to come up with a formula that, between 2 dates, would calculate the "downtime hours", that is, the total hours it has been under repairs minus the hours between 00h00 and 05h00.
    (of course, if a repair stars and ends between 00h00 and 05h00, the "downtime hours" would be null).

    I have attached an Excel file of what I'm looking for.

    Thank you very much for your time.

    All best,
    Attached Files Attached Files

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Calculate downtime while some time ranges are excluded

    one option which would replicate your expected results

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

  3. #3
    Registered User
    Join Date
    10-05-2021
    Location
    Brussels
    MS-Off Ver
    Microsoft 365 for Entreprise
    Posts
    6

    Re: Calculate downtime while some time ranges are excluded

    Hello XLent, thank you very much, and sorry for the late reply.

    The formula does seem to work wonderfully, but would you mind explaining how it works exactly? I admit I am not very savvy with Excel.

    EDIT: The formula gives an error when start time is close to midnight and end time is before 5AM apparently?
    I have attached the Excel file updated with the formula, and marked in yellow where it gives the error; as you can imagine, the formula should return 01:00:00 (1 hour from 23h to 00h00, the 3 hours between 00h00 and 03h00 are not counted).

    All best,
    Attached Files Attached Files
    Last edited by Danielosama; 10-06-2021 at 04:07 AM.

  4. #4
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Calculate downtime while some time ranges are excluded

    my bad -- modified:

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

  5. #5
    Registered User
    Join Date
    10-05-2021
    Location
    Brussels
    MS-Off Ver
    Microsoft 365 for Entreprise
    Posts
    6

    Re: Calculate downtime while some time ranges are excluded

    Quote Originally Posted by XLent View Post
    my bad -- modified:
    Wonderful, thank you very much XLent, you've been a lifesaver.

+ 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] Categorize time ranges and calculate events within the time period
    By yklanka in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-09-2019, 10:16 AM
  2. [SOLVED] Formaula to calculate the downtime monthwise
    By Nitinkumar in forum Excel General
    Replies: 4
    Last Post: 03-23-2016, 08:14 AM
  3. [SOLVED] calculate downtime on a running timesheet
    By sunflowersherri in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-08-2016, 09:59 PM
  4. Calculate downtime between two dates exclude weekends
    By annice in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-09-2012, 07:19 AM
  5. Calculate time outside of specified ranges
    By delirium in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 10-31-2012, 12:16 PM
  6. calculate time intersect between 2 time ranges
    By kanopy123 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-15-2011, 10:09 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