+ Reply to Thread
Results 1 to 14 of 14

[SOLVED] Evaluate a time slot if it is in a range

  1. #1
    Registered User
    Join Date
    06-12-2012
    Location
    ath
    MS-Off Ver
    Excel 2019
    Posts
    53

    [SOLVED] Evaluate a time slot if it is in a range

    hi there

    i am looking to find a solution in order to evaluate if a time slot is in a range of time.

    for example i have a time slot 19:00-03:00 i want to find how many hours are between 22:00-06:00 the result should be 5h

    any ideas?

    kindlytest.xlsx
    Last edited by ids_73; 03-12-2023 at 05:12 AM. Reason: solved

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

    Re: Evaluate a time slot if it is in a range

    It would help if you attached a sample Excel workbook, so we can see exactly how your data is laid out. The yellow banner at the top of the screen explains how you can do this.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    02-03-2012
    Location
    Bangalore, INDIA
    MS-Off Ver
    O365
    Posts
    54

    Re: Evaluate a time slot if it is in a range

    Hi,

    Added two helper cells, G1=22:00 and H1=06:00

    Enter the below formula in F2 and copy down till required range.

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


    Please refer to the attached file for the completed/finished result.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-12-2012
    Location
    ath
    MS-Off Ver
    Excel 2019
    Posts
    53

    Re: Evaluate a time slot if it is in a range

    hi there ,
    first of all thenk you for the help.
    there is an issue if the start time is at 05:00 and the end time is at 13:00 the result is 0 but it should be 1

    any idea about that

  5. #5
    Registered User
    Join Date
    02-03-2012
    Location
    Bangalore, INDIA
    MS-Off Ver
    O365
    Posts
    54

    Re: Evaluate a time slot if it is in a range

    Could you please inform me of all duty slots or time slots that occur between 22:00 and 06:00?

  6. #6
    Registered User
    Join Date
    06-12-2012
    Location
    ath
    MS-Off Ver
    Excel 2019
    Posts
    53

    Re: Evaluate a time slot if it is in a range

    there are no specific standart slots.
    the only standar is that if the working slot is some time betewen 22:00 - 06:00 then that period is in the night shift.

  7. #7
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,004

    Re: Evaluate a time slot if it is in a range

    Try this,

    E2
    =IF(D2>C2,D2-C2,(1-C2)+D2)*24

    F2
    =IFERROR(1/(1/(IF(D2>C2, (MEDIAN(C2,D2,1)-MEDIAN(C2,D2,22/24))+ (MEDIAN(C2,D2,6/24)-MEDIAN(C2,D2,0)), (1-MEDIAN(C2,1,22/24))+ MEDIAN(0,D2,6/24) )*24)),"-")

    copied down.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-12-2012
    Location
    ath
    MS-Off Ver
    Excel 2019
    Posts
    53

    Re: Evaluate a time slot if it is in a range

    hi there again,

    it looks ok now but i have a question if i may.

    what is the perpose of this 1/(1/(IF(D2>C2,...

  9. #9
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,004

    Re: Evaluate a time slot if it is in a range

    The purpose is if answer is 0 to output "-".
    If you don't need it, you can modify formula as follows

    F2
    =IF(D2>C2,(MEDIAN(C2,D2,1)-MEDIAN(C2,D2,22/24))+(MEDIAN(C2,D2,6/24)-MEDIAN(C2,D2,0)),(1-MEDIAN(C2,1,22/24))+MEDIAN(0,D2,6/24))*24
    Last edited by windknife; 03-12-2023 at 05:13 AM.

  10. #10
    Registered User
    Join Date
    06-12-2012
    Location
    ath
    MS-Off Ver
    Excel 2019
    Posts
    53

    Re: Evaluate a time slot if it is in a range

    thank all for the help

    it works as i was looking for.

  11. #11
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,004

    Re: [SOLVED] Evaluate a time slot if it is in a range

    You are welcome.

  12. #12
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,386

    Re: [SOLVED] Evaluate a time slot if it is in a range

    Or

    Please Login or Register  to view this content.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    02-03-2012
    Location
    Bangalore, INDIA
    MS-Off Ver
    O365
    Posts
    54

    Re: [SOLVED] Evaluate a time slot if it is in a range

    Quote Originally Posted by JEC. View Post
    Or

    Please Login or Register  to view this content.
    Please check, there is an issue if the start time is at 05:00 and the end time is at 13:00 the result is 00:00 but it should be 01:00.

  14. #14
    Forum Expert
    Join Date
    10-11-2021
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    1,386

    Re: [SOLVED] Evaluate a time slot if it is in a range

    And now?

    Please Login or Register  to view this content.

+ 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. How can I formulate my Entry Time Raw Data within a specific Time Slot Range
    By variantquery91 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-26-2019, 04:28 AM
  2. Edit cells at a given time slot ?
    By antonywijesinghe in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-07-2019, 01:05 AM
  3. Time Slot Reservation Form
    By dknightstone in forum Excel General
    Replies: 1
    Last Post: 03-30-2017, 08:20 PM
  4. [SOLVED] I wish to make a time slot
    By oO P2K Oo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-09-2016, 12:27 PM
  5. [SOLVED] Calculating longest waiting time at given time slot
    By dvs in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-03-2013, 06:20 PM
  6. Replies: 1
    Last Post: 03-28-2012, 12:11 PM
  7. Return cell contents during a time slot.
    By Pompano Tom in forum Excel General
    Replies: 2
    Last Post: 03-22-2007, 08:45 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