Formula Help with overlapping times

yessir

Board Regular
Joined
Jun 7, 2019
Messages
103
Office Version
  1. 2021
Platform
  1. MacOS
I am trying to find a formula that would help me find how many cars overlap and are in the lot at the same time but only when column D is False. I would then want to count how many cars are in the lot at the same time. The start times are located in B2:B7 and end times are in C2:C7. I've tried using a SUMPRODUCT function but was wondering if there was an easier way to go about this and include the function to count the number of cars that overlap.
A B C D
Arvl Lot Location Arvl Time Dept TimeIs Overnight
xxx15:2516:10FALSE
xxx21:1022:15FALSE
xxx8:219:19FALSE
xxx11:0811:45FALSE
xxx14:2915:15FALSE
xxx19:5521:20FALSE

<tbody>
</tbody>
 
Last edited by a moderator:
My last attempt...

A possible solution using helper columns

A
B
C
D
E
F
G
1
Arvl Place​
Arvl Time​
Dept Time​
Helper1​
Helper2​
Is Overnight​
Num of Overlaps​
2
jjj​
20:09​
06:33​
20,15​
30,55​
TRUE​
0​
3
jjj
11:05​
12:03​
11,08​
12,05​
FALSE​
4​
4
jjj​
09:26​
10:16​
9,43​
10,27​
FALSE​
2​
5
jjj​
23:52​
01:15​
23,87​
25,25​
FALSE​
0​
6
jjj​
15:13​
16:03​
15,22​
16,05​
FALSE​
2​
7
jjj​
22:02​
05:00​
22,03​
29,00​
TRUE​
0​
8
jjj​
18:26​
06:45​
18,43​
30,75​
TRUE​
0​
9
jjj​
20:06​
06:00​
20,10​
30,00​
TRUE​
0​
10
jjj​
15:51​
16:41​
15,85​
16,68​
FALSE​
3​
11
jjj​
11:52​
12:48​
11,87​
12,80​
FALSE​
3​
12
jjj​
08:03​
08:53​
8,05​
8,88​
FALSE​
0​
13
jjj​
13:30​
14:20​
13,50​
14,33​
FALSE​
3​
14
jjj​
17:52​
18:42​
17,87​
18,70​
FALSE​
2​
15
jjj​
10:02​
10:47​
10,03​
10,78​
FALSE​
3​
16
jjj​
18:28​
19:40​
18,47​
19,67​
FALSE​
2​
17
jjj
22:55​
06:00​
22,92​
30,00​
TRUE​
0​
18
jjj​
13:39​
14:21​
13,65​
14,35​
FALSE​
3​
19
jjj​
19:03​
19:45​
19,05​
19,75​
FALSE​
1​
20
jjj​
09:31​
10:21​
9,52​
10,35​
FALSE​
2​
21
jjj​
22:28​
23:24​
22,47​
23,40​
FALSE​
0​
22
jjj​
22:27​
12:28​
22,45​
36,47​
TRUE​
0​
23
jjj​
13:33​
14:18​
13,55​
14,30​
FALSE​
3​
24
jjj​
15:59​
17:20​
15,98​
17,33​
FALSE​
3​
25
jjj​
11:48​
12:28​
11,80​
12,47​
FALSE​
3​
26
jjj​
10:47​
11:37​
10,78​
11,62​
FALSE​
3​
27
jjj​
13:59​
15:00​
13,98​
15,00​
FALSE​
3​
28
jjj​
16:38​
18:00​
16,63​
18,00​
FALSE​
3​
29
jjj​
22:04​
07:55​
22,07​
31,92​
TRUE​
0​
30
jjj
11:13​
11:58​
11,22​
11,97​
FALSE​
4​

<tbody>
</tbody>


Helper1
Formula in D2 copied down
=B2*24
Format as Number with 2 decimal places

Helper2
Formula in E2 copied down
=(C2+(B2>C2))*24
Format as Number with 2 decimal places

Formula in G2 copied down
=IF(F2=FALSE,SUMPRODUCT(--(ROW(A$2:A$400)<>ROW(A2)),--(A$2:A$400=A2),--(A$2:A$400<>""),--(F$2:F$400=FALSE),1-((D2>E$2:E$400)+(D$2:D$400>E2))),0)

M.
 
Last edited by a moderator:
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
It worked great, if i might ask. What was your reasoning when creating the helper columns.
 
Last edited by a moderator:
Upvote 0
It worked great, if i might ask. What was your reasoning when creating the helper columns.

To adjust the value of column C by adding 1 (24 hours) because it is on the next day when it is less than the value of column B.

M.
 
Upvote 0

Forum statistics

Threads
1,216,069
Messages
6,128,599
Members
449,460
Latest member
jgharbawi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top