Hey everyone,
I'm trying to calculate the number of business hours between 2 dates + times. I've tried using two formulas and was able to get correct values for entries with the same date, but for lines with different created times and resolved times, I'm getting incorrect values. I could use some help asap.
I'm trying to calculate the number of business hours between 2 dates + times. I've tried using two formulas and was able to get correct values for entries with the same date, but for lines with different created times and resolved times, I'm getting incorrect values. I could use some help asap.
Business Hours Calculation.xlsx | |||||||||
---|---|---|---|---|---|---|---|---|---|
E | F | G | H | I | J | K | |||
1 | Create Time | Resolved Time | 8:00:00 AM | 7:00:00 PM | |||||
2 | 8/18/2021 5:09 PM | 8/18/2021 5:44 PM | 0:35:12 | 0:35:12 | Opening | Closing | |||
3 | 8/18/2021 5:35 PM | 8/19/2021 3:36 PM | -12:59:21 | #VALUE! | |||||
4 | 8/23/2021 2:20 PM | 8/23/2021 3:59 PM | 1:38:07 | 1:38:07 | |||||
5 | 8/24/2021 1:34 PM | 8/24/2021 1:49 PM | 0:15:00 | 0:15:00 | |||||
6 | 8/19/2021 2:25 PM | 8/22/2021 8:58 AM | -16:27:20 | -14:25:50 | |||||
7 | 9/2/2021 12:26 PM | 9/2/2021 2:01 PM | 1:34:32 | 1:34:32 | |||||
8 | 8/19/2021 4:03 PM | 8/19/2021 4:32 PM | 0:28:44 | 0:28:44 | |||||
9 | 8/23/2021 10:50 AM | 8/24/2021 7:17 AM | -14:33:06 | -3:33:06 | |||||
10 | 8/19/2021 11:18 AM | 8/19/2021 1:54 PM | 2:36:18 | 2:36:18 | |||||
11 | 8/18/2021 9:16 AM | 8/18/2021 10:56 AM | 1:40:08 | 1:40:08 | |||||
12 | 8/18/2021 11:36 AM | 8/18/2021 12:00 PM | 0:23:54 | 0:23:54 | |||||
13 | 8/19/2021 4:45 PM | 8/19/2021 5:27 PM | 0:41:56 | 0:41:56 | |||||
14 | 8/20/2021 11:57 AM | 8/22/2021 7:08 AM | -4:49:26 | -11:57:43 | |||||
15 | 8/19/2021 4:42 PM | 8/22/2021 10:28 AM | -17:14:09 | -16:42:10 | |||||
16 | 8/19/2021 10:37 AM | 8/19/2021 4:11 PM | 5:33:42 | 5:33:42 | |||||
17 | 8/19/2021 4:42 PM | 8/19/2021 5:10 PM | 0:28:14 | 0:28:14 | |||||
18 | 8/19/2021 1:23 PM | 8/19/2021 4:57 PM | 3:33:18 | 3:33:18 | |||||
19 | 8/22/2021 12:19 PM | 8/23/2021 8:56 AM | -3:23:04 | 8:56:40 | |||||
20 | 8/24/2021 10:23 AM | 8/25/2021 6:39 AM | -14:43:55 | -3:43:55 | |||||
21 | 8/30/2021 8:29 AM | 8/30/2021 8:50 AM | 0:20:27 | 0:20:27 | |||||
22 | 10/5/2021 12:52 PM | 10/5/2021 1:43 PM | 0:50:49 | 0:50:49 | |||||
23 | 8/27/2021 10:11 AM | 8/29/2021 9:49 AM | -0:22:10 | -10:11:13 | |||||
24 | 8/19/2021 2:41 PM | 8/19/2021 4:31 PM | 1:49:14 | 1:49:14 | |||||
25 | 9/6/2021 10:50 AM | 9/6/2021 2:07 PM | 3:17:04 | 3:17:04 | |||||
26 | 9/6/2021 5:06 PM | 9/6/2021 6:01 PM | 0:55:43 | 0:55:43 | |||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
G2:G26 | G2 | =(NETWORKDAYS(E2,F2)-1)*($J$1-$K$1)+MOD(F2,1)-MOD(E2,1) |
H2:H26 | H2 | =(NETWORKDAYS(E2,F2)-1)*(J1-K1) +IF(NETWORKDAYS(F2,F2),MEDIAN(MOD(F2,1),J1,K1),J1) -MEDIAN(NETWORKDAYS(E2,E2)*MOD(E2,1),J1,K1) |