• 464K Members
• 11.4K Online
• 560K Conversations
SOLVED

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

Occasional Contributor

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

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
9 Replies

# Re: Counting of business and non business hours white a ticket was open

I have developed a formula according to the conditions you require, please check in the attached sheet and let me know to have detailed description, if it solves your problem.

# Re: Counting of business and non business hours white a ticket was open

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

Solution

# Re: Counting of business and non business hours white a ticket was open

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)

# Re: Counting of business and non business hours white a ticket was open

Thanks a lot for your help,it is effective formula for the most of data but the problem now is when i tried to drag and drop the formula to the rest of data, in some cells it gives me #name! or #num! excel error as shown on the attached file, and on some cells like cell(Z3), the formula results ( in business hours> duration ), and that is not correct and therefore gives negative # of non business hours..

to solve the negativity problem i observed that this issue only happened when non business hours=0,so i can filter these cells and choose business hours = duration directly.

# Re: Counting of business and non business hours white a ticket was open

Something strange, I opened the file you attached to the latest post and see no one #NAME! or #NUM! error. Calculations are also correct (at least Business Hours are less than Duration)

All negative results are -0.01 as at the bottom right of above screenshort. That's rounding error, you may entire formula for Non-Busiess hours as

=IF(<formula> <0, 0, <formula>)

I recalculate the sheet, please check attached again.

# Re: Counting of business and non business hours white a ticket was open

The formula works perfect.

Thanks a lot for your time and effort.

# Re: Counting of business and non business hours white a ticket was open

If I want to exclude the official holidays from the business and non-business hours calculations, how I can exclude them without affecting the formula, I already defined the holidays at column AG as shown in the attached file.

what about if I added the optional parameter "Holidays" referes to dates that should be considered as non-work days"Holidays" in the NETWORKDAYS.INTL excel function , is it enough or should i do or edit more?

# Re: Counting of business and non business hours white a ticket was open

what about if I added the optional parameter "Holidays" referes to dates that should be considered as non-work days"Holidays" in the NETWORKDAYS.INTL excel function , is it enough or should i do or edit more?

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies