+ Reply to Thread
Results 1 to 2 of 2

Calculate time between three periods

  1. #1
    Registered User
    Join Date
    08-24-2009
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    36

    Calculate time between three periods

    I need to calculate three times during periods that span two different days.

    I.e.
    1. Hours before midnight;
    2. Hours before 6.30 am and
    3. if needed the hours after 6.30am

    as follows

    Start Time Finish time Total Hrs B4 Midnight Decimal Total Hours Between Midnight and 6:30am Decimal After 6:30am Decimal

    21:20 7:45 2:40 2.66 6:30 6.5 1:45 1.75


    What is the best solutions' an 'if statement' ?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Calculate time between three periods

    M1: 6:30 - the early AM cutoff time, for formula reference
    A2: 21:20
    B2: 7:45
    C2: =IF(A2>B2, (1-A2), "")
    D2: =IF(C2<>"", C2*24, "")
    E2: =IF(A2>B2, MIN($M$1,B2), IF(A2<$M$1, $M$1-A2, ""))
    F2: =IF(E2 <> "", E2*24, "")
    G2: =IF(A2>B2, IF(B2>$M$1, B2-$M$1, ""), IF(A2<$M$1, IF(B2>$M$1, B2-$M$1, ""), B2-A2))
    H2: =IF(G2<>"", G2*24, "")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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