+ Reply to Thread
Results 1 to 5 of 5

Condition Formulas for Counting hours between Time Shifts

  1. #1
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    9

    Condition Formulas for Counting hours between Time Shifts

    Hi guys!

    I need a non-macro formula to help solve the following scenarios. Ideally this formula would be all encompassing (to include other scenarios as well if something similar were to come up in the future):

    Scenario 1:
    Start Time End Time
    A 12:00:00 AM 12:00:00 AM
    B 6:00:00 PM 6:00:00 AM

    Scenario 2:
    Start Time End Time
    A 12:00:00 AM 6:00:00 AM
    B 6:00:00 PM 6:00:00 AM

    Scenario 3:
    Start Time End Time
    A 6:00:00 PM 2:00:00 AM
    B 6:00:00 PM 6:00:00 AM

    Scenario 4:
    Start Time End Time
    A 8:00:00 AM 5:00:00 PM
    B 6:00:00 PM 6:00:00 AM

    If A occurs between B (or vice versa), then calculate how many hours from A occur between B. So it should calculate the following:

    Scenario 1: 12 hours
    Scenario 2: 6 hours
    Scenario 3: 8 hours
    Scenario 4: 0 hours (Because A does not occur between B)

    This can be broken down into several simpler formulas which would show the steps to get to the final answer.

    Thanks so much for your help!

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Condition Formulas for Counting hours between Time Shifts

    Mathematically, I get 6 hours for Scenario 1
    and Scenario 2 can be either 6 or 0 depending on whether "A" is day 1 or day 2 of the time frame.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Condition Formulas for Counting hours between Time Shifts

    This is assuming that everything occurs on the same day, in a single-day time span.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Condition Formulas for Counting hours between Time Shifts

    Start Time End Time
    A 12:00:00 AM 12:00:00 AM
    B 6:00:00 PM 6:00:00 AM
    How can you start at 6PM and end at 6AM on the same day?

  5. #5
    Registered User
    Join Date
    05-16-2014
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Condition Formulas for Counting hours between Time Shifts

    A is considered a shift
    B is considered a rule of which the shift must abide to. Therefore, A must be applied to B in the time-span of a single day (technically, B can also be seen as 12:00:00 AM-6:00:00 AM AND 6:00:00 PM-12:00:00 AM).

    For Scenario 1:
    Row A represents 24 hours.
    To apply it to Row B:
    12:00:00 AM - 6:00:00 AM would be 6 hours
    6:00:00 PM - 12:00:00 AM would be 6 hours
    Add them up to equal 12 hours total to apply to the rule of 6:00:00 PM - 6:00:00 AM.

    Keep asking questions as this is a complicated situation.

+ 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. Calculate Several Sub Shifts Hours
    By ioncila in forum Excel General
    Replies: 2
    Last Post: 04-01-2014, 11:00 AM
  2. [SOLVED] Counting events in a date table over 24 hours based on a condition.....
    By sambashir in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-08-2013, 06:04 AM
  3. Replies: 8
    Last Post: 02-21-2012, 01:38 PM
  4. Replies: 6
    Last Post: 01-17-2011, 12:12 AM
  5. Shifts Hours
    By ElmerS in forum Excel General
    Replies: 3
    Last Post: 02-20-2010, 10:27 AM

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