Formula Help with overlapping times

yessir

Board Regular
Joined
Jun 7, 2019
Messages
91
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:

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi, welcome to the board.

Help us out with your data please.
With the sample data provided, what should the results be, and why ?
 
Upvote 0
The result should be a count of the overlapping cars that are in the lot that do not stay overnight. The reason for this is because I need to know how many cars are in the lot at overlapping times.
 
Upvote 0
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>

Try this formula
=IF(D2=FALSE,SUMPRODUCT((B2<$C$2:$C$7)*(C2>=$B$2:$B$7))>1,"")

paste this in row 2 in any column and drag it down to all your data
please note $C$2:$C$7 you should be putting your entire dept time range, so if you have 100 dates then it would be $C$2:$C$102, just basically grab your entire range of dept time, and click f4 to lock the reference, and then do the same thing where it says $B$2:$B$7 but instead of end dates put arvl time range
 
Last edited by a moderator:
Upvote 0
Yeah so what is the answer with that sample data ?
1?
2?
3?

I THINK rows 2 and 6 overlap on time, if I am reading this correctly.
If that's right, what should the answer be ?
2 ?
 
Upvote 0
Yeah so what is the answer with that sample data ?
1?
2?
3?

I THINK rows 2 and 6 overlap on time, if I am reading this correctly.
If that's right, what should the answer be ?
2 ?

Yes good point he did not specify what he wants it to return if the condition is true or not.
My results looked like this
Arvl Lot LocationArvl TimeDept TimeIs OvernightOverlap
xxx15:2516:10FALSEFALSE
xxx21:1022:15FALSETRUE
xxx8:219:19FALSEFALSE
xxx11:0811:45FALSEFALSE
xxx14:2915:15FALSEFALSE
xxx19:5521:20FALSETRUE

<tbody>
</tbody>


I think he said he wants the count, so he can use this formula instead
=IF(D2=FALSE,if(SUMPRODUCT((B2<$C$2:$C$7)*(C2>=$B$2:$B$7))>1,1,0),0)
and it will give him the count

Arvl Lot LocationArvl TimeDept TimeIs OvernightOverlap
xxx15:2516:10FALSE0
xxx21:1022:15FALSE1
xxx8:219:19FALSE0
xxx11:0811:45FALSE0
xxx14:2915:15FALSE0
xxx19:5521:20FALSE1

<tbody>
</tbody>

 
Last edited by a moderator:
Upvote 0
You are correct the Answer should be 2. Is there a way to write a formula that would then be able to count the Number of times the True value was returned from the formula that you gave me.
 
Upvote 0
You are correct the Answer should be 2. Is there a way to write a formula that would then be able to count the Number of times the True value was returned from the formula that you gave me.

=IF(D2=FALSE,if(SUMPRODUCT((B2<$C$2:$C$7)*(C2>=$B$2:$B$7))>1,1,0),0)
Use this

and then sum the entire column in a cell, so if you are posting this formula to E column
Then in F1 or anywhere you want outside the data type =SUM(E:E)
 
Upvote 0
Thanks so much for your help. The formula worked great. However, I do have a follow up question.
A B C D E
Arvl PlaceArvl TimeDept TimeIs OvernightOverlap
xxx8:219:19FALSE0
xxx11:0811:45FALSE0
xxx14:2915:15FALSE0
xxx15:2516:10FALSE0
xxx19:5521:20FALSE1
xxx21:1022:15FALSE1
yyy21:3222:00FALSE
yyy17:3320:00FALSE
yyy19:4220:28FALSE
yyy19:4020:37FALSE
yyy14:4115:16FALSE
yyy17:4918:46FALSE
yyy7:5010:50FALSE
yyy15:5516:40FALSE

<tbody>
</tbody>

Is there a way to write ino the formula for it to be able to distingush the change in coloum A? Meaning the formula would only check overlap times when coloum A is the same? Thanks.
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,215,332
Messages
6,124,313
Members
449,153
Latest member
JazzSingerNL

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