Forum Discussion

Bob_m_m's avatar
Bob_m_m
Copper Contributor
Jan 11, 2023
Solved

Excel one cell formula for calculating Actual SLA End date & time

Criteria 
22:00 - 08:00 - Freezing time

 

SLA - 6 Hrs from Registered Date & Time


  • mtarler's avatar
    mtarler
    Jan 11, 2023

    JoeUser2004  i think Bob_m_m wanted a formula to calculate the END time not how much time is in between 2 values.  Here is my formula (that works on older excel):

    =IF(E6+6/24<=INT(E6)+$D$3,MAX(E6,INT(E6)+$E$3)+6/24,$E$3+1+6/24-$D$3+MIN(E6,INT(E6)+$D$3))

     and using the newer LET:

    =LET(in,E6, delay,6/24, dEnd,$D$3, dStart,$E$3,
    d,INT(in), h,in-d, freeze,1-dEnd+dStart,
    IF(h+delay<=dEnd,MAX(in,d+dStart)+delay, freeze+delay+MIN(in,d+dEnd)))

    this version is a little easier if you need to tweak values and hopefully a little easier to understand/see what is being done.

  • Bevin's avatar
    Bevin
    Copper Contributor

    Bob_m_m 

    Hi 

    Can aby one help to resolve the below

    2.46 AM - 17:44 PM - Freezing time

     

    SLA - 4 Hrs from Registered Date & Time

  • Bevin's avatar
    Bevin
    Copper Contributor

    Hi Team,

    Can aby one help to resolve the below

    2.46 AM - 17:44 PM - Freezing time

     

    SLA - 4 Hrs from Registered Date & Time

    • mtarler's avatar
      mtarler
      Silver Contributor

      JoeUser2004  i think Bob_m_m wanted a formula to calculate the END time not how much time is in between 2 values.  Here is my formula (that works on older excel):

      =IF(E6+6/24<=INT(E6)+$D$3,MAX(E6,INT(E6)+$E$3)+6/24,$E$3+1+6/24-$D$3+MIN(E6,INT(E6)+$D$3))

       and using the newer LET:

      =LET(in,E6, delay,6/24, dEnd,$D$3, dStart,$E$3,
      d,INT(in), h,in-d, freeze,1-dEnd+dStart,
      IF(h+delay<=dEnd,MAX(in,d+dStart)+delay, freeze+delay+MIN(in,d+dEnd)))

      this version is a little easier if you need to tweak values and hopefully a little easier to understand/see what is being done.

      • Bob_m_m's avatar
        Bob_m_m
        Copper Contributor
        Superb working formula. Thank you very much for your support and time. Have a nice day.
  • mtarler's avatar
    mtarler
    Silver Contributor

    Bob_m_m  i don't understand.  The numbers given aren't +6hrs in the 2nd column.  In the attached I show the difference and a formula for finding the orginal + 6hrs, which is simply take the original date-time and add 6/24 (i.e. # hrs / 24 hrs)

    =A1 + 6/24

     

    • Bob_m_m's avatar
      Bob_m_m
      Copper Contributor
      it is 6hrs excluding night excluding criteria from night 10PM to morning 8AM

Resources