+ Reply to Thread
Results 1 to 8 of 8

Calculate decimal hours within a range from another range

  1. #1
    Registered User
    Join Date
    08-03-2021
    Location
    Bath, England
    MS-Off Ver
    Version 2008
    Posts
    2

    Calculate decimal hours within a range from another range

    I need to calculate, in decimal hours, how many of the hours from a specified range, fall within another specified range. For example, for each of the ranges below, I need to know how many decimal hours fall between 07:00 and 17:00:

    07:00 to 19:30
    09:30 to 16:30
    07:00 to 14:00
    09:30 to 19:45

    Please help!
    Attached Files Attached Files
    Last edited by Alaird; 08-03-2021 at 06:40 AM.

  2. #2
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,805

    Re: Calculate decimal hours within a range from another range

    Welcome to the forum.

    There is no MS Office 10 - which version do you have? Please update your profile. Thanks.
    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.

  3. #3
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,805

    Re: Calculate decimal hours within a range from another range

    My initial response is this:

    =C2-B2

    If that's not it, then please manually populate the results column with what you want to see and post your sample workbook again.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,725

    Re: Calculate decimal hours within a range from another range

    You can use this formula in D2:

    =(MIN(TIME(17,0,0),C2)-MAX(TIME(7,0,0),B2))*24

    Format as General or Number, then copy down as required.

    Hope this helps.

    Pete

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

    Re: Calculate decimal hours within a range from another range

    edit: below is just a variant of Pete's approach above...
    I think it would be along lines of:

    =MIN("17:00",C2)-MAX("07:00",B2)
    copied down

    if you can have start / end times that cross midnight let us know

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,725

    Re: Calculate decimal hours within a range from another range

    The OP wants it as decimal hours, rather than time format.

    Pete

  7. #7
    Registered User
    Join Date
    08-03-2021
    Location
    Bath, England
    MS-Off Ver
    Version 2008
    Posts
    2

    Re: Calculate decimal hours within a range from another range

    Fantastic, that works, thank you!!!

  8. #8
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,805

    Re: Calculate decimal hours within a range from another range

    Please update your profile to MS365.

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

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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] Calculate and Return decimal value between range
    By Aquarock in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-14-2021, 01:53 PM
  2. Calculate the difference in hours in a range
    By marduk87RP in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-31-2020, 12:15 PM
  3. [SOLVED] Formula to calculate range of hours
    By GregM56 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-06-2017, 02:48 PM
  4. [SOLVED] How Can I Calculate Hours in a Given Range?
    By Sandcastle in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-10-2014, 05:09 PM
  5. Calculate number of hours within range
    By miego in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-12-2014, 05:50 PM
  6. Formula to Calculate Hours over Week Range
    By ssteines in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-20-2010, 10:41 AM
  7. Converting individual cells within a range from minutes to decimal hours
    By epyzdrh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2008, 09:53 AM

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