Forum Discussion

Najat_abu_hamad's avatar
Najat_abu_hamad
Copper Contributor
Oct 01, 2019
Solved

Counting of business and non business hours white a ticket was open

Kindly your help
I need your help in developing a formula to count the business and non business hours for a group of tickets.. I have data about entering and releasing time.. And i want to split the used time acoarding to a special time like from sun to Thu the business hours from( 8:00-16:00) and from(16:00 - 00:00) while from 00:00-8:00 should be count as non business hours.. But on fri and saturday the whole working hours are count as non business hours..
Thank you
  • SergeiBaklan's avatar
    SergeiBaklan
    Oct 02, 2019

    Najat_abu_hamad 

    If add helper columns like this

    not to harcode constants, the formula could be

    =24*(
       IF(
          INT(Q2)-INT(P2)>2,
          NETWORKDAYS.INTL(P2+1,Q2-1,7),0
       ) +
       IF(
          INT(Q2)=INT(P2),
          MIN(MOD(Q2,1),$AF$2)-MAX(MOD(P2,1),$AE$2),
          ($AF$2-MAX(MOD(P2,1),$AE$2))*(WEEKDAY(P2,15)>2) +
          MAX(MOD(Q2,1)-$AE$2,0)*(WEEKDAY(Q2,15)>2)
       )
    )

    result in hours (e.g. 1.5 hour, not 01:30)

9 Replies

    • Najat_abu_hamad's avatar
      Najat_abu_hamad
      Copper Contributor

      HiVimal_Gaur 

      Thank you for your effort...

      the point that most of the tickets were open between two dates,i.e:severaldays and different time schedule,

      here is the required task showing below and the attached file have the data you may need to understand the process:

      calculate the number of business and non-business hours accoarding to the table on the attached screenshoot (plz,make it configurable, not hardcoded as the time scheduling table may change, whereby the sum of business and non business hours should equal the difference between columns  Q-P 

       

       

      • SergeiBaklan's avatar
        SergeiBaklan
        Diamond Contributor

        Najat_abu_hamad 

        If add helper columns like this

        not to harcode constants, the formula could be

        =24*(
           IF(
              INT(Q2)-INT(P2)>2,
              NETWORKDAYS.INTL(P2+1,Q2-1,7),0
           ) +
           IF(
              INT(Q2)=INT(P2),
              MIN(MOD(Q2,1),$AF$2)-MAX(MOD(P2,1),$AE$2),
              ($AF$2-MAX(MOD(P2,1),$AE$2))*(WEEKDAY(P2,15)>2) +
              MAX(MOD(Q2,1)-$AE$2,0)*(WEEKDAY(Q2,15)>2)
           )
        )

        result in hours (e.g. 1.5 hour, not 01:30)