+ Reply to Thread
Results 1 to 4 of 4

Calculate how many hours between two times are before midnight and after midnight

  1. #1
    Forum Contributor
    Join Date
    02-07-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    105

    Calculate how many hours between two times are before midnight and after midnight

    Hi everyone,

    How would you return number of hours between hour x and midnight and number of hours between midnight and hour y?
    A1: start time (hour x)
    B1: end time (hour y)
    C1: sum of hours between A1 and midnight
    D1: sum of hours between midnight and B1

    Is there a light way of doing it please?
    Came up with this but not sure if its right:
    Please Login or Register  to view this content.
    Could you please suggest a good/alternative way of approaching this?
    Last edited by annazet; 12-06-2019 at 10:10 AM.

  2. #2
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Calculate how many hours between two times are before midnight and after midnight

    Based on your own formula (for rownr) and result in true time notation

    use in C4 (before midnight)
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    use in D4 (after midnight)
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    A good thing to remember is that times are always a fraction of 1. so 1 = 24hrs exactly.
    hours after midnight dont need a calculation as every day starts counting from 0 so 2 o'clock is also 2 hours after midnight only posible AM/PM notations needs to be omitted to show 1PM as 13:00 after midnight

    see attachment for result. play with start and end time to see the outcome change
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    02-07-2013
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    105

    Re: Calculate how many hours between two times are before midnight and after midnight

    Quote Originally Posted by Roel Jongman View Post
    Based on your own formula (for rownr) and result in true time notation

    use in C4 (before midnight)
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    use in D4 (after midnight)
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    A good thing to remember is that times are always a fraction of 1. so 1 = 24hrs exactly.
    hours after midnight dont need a calculation as every day starts counting from 0 so 2 o'clock is also 2 hours after midnight only posible AM/PM notations needs to be omitted to show 1PM as 13:00 after midnight

    see attachment for result. play with start and end time to see the outcome change
    Thank you; always overcomplicate things; thank you for taking this burden off my shoulders xx

  4. #4
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: Calculate how many hours between two times are before midnight and after midnight

    Your welcome, I also used to struggle with time calculations for a long time, but at some point the penny dropped on how they work in excel and now it is simple not to overcomplicate.

+ 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] Formula Needed - Hours between times crossing midnight
    By meowmix7903 in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 08-30-2017, 05:52 AM
  2. How Can I Work Out a time Before Midnight and After Midnight???
    By ArmandDataCube in forum Excel General
    Replies: 7
    Last Post: 08-23-2017, 06:13 PM
  3. Replies: 2
    Last Post: 02-02-2017, 05:18 AM
  4. [SOLVED] Need to calculate the difference between two times over midnight - with a diference
    By rossi_69 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-06-2015, 12:20 PM
  5. [SOLVED] Formula to calculate: # of hours in a timespan that fall between Midnight and 6AM
    By Deicidium in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-23-2015, 05:05 PM
  6. Trying to calculate +/- min for actual times before and after midnight
    By WTFCanucks in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 11-11-2014, 12:08 PM
  7. How to calculate hours when it goes after midnight.
    By gps08 in forum Excel General
    Replies: 13
    Last Post: 06-21-2014, 04:19 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