+ Reply to Thread
Results 1 to 6 of 6

Return a OT (OT01,OT02) Hours as per Condition.

  1. #1
    Forum Contributor
    Join Date
    08-19-2020
    Location
    Dubai
    MS-Off Ver
    Office365
    Posts
    131

    Return a OT (OT01,OT02) Hours as per Condition.

    Hi,


    The formula help is needed to return a result for columns F and G based on the start and finish times specified in columns D and E.

    The OT01 hours should be calculated below the finish time at 9 PM in actual working days.

    As stated in sample results, OT02 is calculate after 9 PM and the total number of hours spent on Sundays and holidays comes under OT02.


    Sample sheet with expected results are attached.


    Thanks,
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Return a OT (OT01,OT02) Hours as per Condition.

    Please amend your sample to include a holiday day, where the start time is < 21:00.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor
    Join Date
    08-19-2020
    Location
    Dubai
    MS-Off Ver
    Office365
    Posts
    131

    Re: Return a OT (OT01,OT02) Hours as per Condition.

    Sample amended enclosed.
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Return a OT (OT01,OT02) Hours as per Condition.

    F2:
    =IF(OR(C6="Sunday",ISNUMBER(MATCH(B6,$J$3,0))),0,(MIN(E6+IF(E6<0.5,1,0),21/24)-D6)*24)

    G2:
    =24*MOD(E6-D6,1)-F6

    Format as General.
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    08-19-2020
    Location
    Dubai
    MS-Off Ver
    Office365
    Posts
    131

    Re: Return a OT (OT01,OT02) Hours as per Condition.

    Many thanks for the your formula solution,

    To demonstrate the issue, I changed the start and finish times of the sample sheet for 04-02-2023 to 5:30 PM and 12:30 PM the next day. For row 11, the results should be OT-01 05 hours and OT-02 15.5 hours, but instead they return OT-01 -5 hours and OT-02 24 hours.

    Furthermore, I did the same for Rows 14 and 16, where the OT-01 and OT-02 hours were not returned as required.

    Sample sheet is attached.

    Thanks,
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: Return a OT (OT01,OT02) Hours as per Condition.

    Try, based on workbook in post #1
    G6=IF(OR(C6="Sunday",D6>0,AND(E6>TIME(21,0,0),F6<TIME(21,0,0))),0,IF(F6<E6,MOD(TIME(21,0,0)-E6,1),MOD(MIN(TIME(21,0,0),F6)-E6,1))*24)
    H6=MOD(F6-E6,1)*24-G6

+ 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. Replies: 13
    Last Post: 12-11-2020, 10:04 AM
  2. Replies: 3
    Last Post: 07-24-2018, 03:24 AM
  3. [SOLVED] Dates w/in 48 hours of each other formula/condition
    By JRose0303 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-05-2016, 01:28 PM
  4. Replies: 1
    Last Post: 06-03-2014, 06:28 PM
  5. Condition Formulas for Counting hours between Time Shifts
    By intercon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-16-2014, 02:37 PM
  6. Calculating staff hours with 30min over/under condition
    By naylordaisy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-16-2013, 05:49 AM
  7. Calculate hours based on condition
    By Busman in forum Excel General
    Replies: 0
    Last Post: 07-20-2011, 02:55 PM

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