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:
The negative numbers are gone, thanks. However, I don't quite understand the formula and what exactly the numbers that they calculate mean. Because the numbers seem to be much higher than the actual number of cars overlapping

An example

Row 3

A
B
C
D
E
3
zzz
19:35​
20:36​
FALSE
5​

<tbody>
</tbody>

Why 5 in E3?
Because it overlaps with

A
B
C
D
12
zzz​
19:00​
20:00​
FALSE​

<tbody>
</tbody>



A
B
C
D
16
zzz​
19:11​
20:49​
FALSE​

<tbody>
</tbody>



A
B
C
D
26
zzz​
19:39​
20:26​
FALSE​

<tbody>
</tbody>



A
B
C
D
32
zzz
19:17​
20:49​
FALSE​

<tbody>
</tbody>



A
B
C
D
42
zzz​
18:53​
20:40​
FALSE​

<tbody>
</tbody>


M.
 
Last edited by a moderator:
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Thank you. Is there a function that would be able to sum up the numbers in column E but only for when colomn A are the same. Therefor it would know to start counting column E from Zero again when Column A changes. Thanks for your help.
 
Last edited by a moderator:
Upvote 0
Try SUMIF

For example
=SUMIF(A:A,"zzz",E:E)

M.
 
Last edited by a moderator:
Upvote 0
I've given it a shot and it seems to only work for zzz but not when Column A has a different Code.
 
Last edited by a moderator:
Upvote 0
Is there a way to omit the numbers until the last cell, so it only returns one value at the bottom.

Column1Column2Column3Column4Column5Column6
qqq6:157:15FALSE11
qqq18:0619:06FALSE01
qqq21:4022:44FALSE12
qqq11:4013:05FALSE13
qqq14:0714:57FALSE03
qqq7:128:50FALSE25
qqq9:3910:52FALSE38
qqq17:1318:00FALSE08
qqq8:469:45FALSE412
qqq20:1021:10FALSE113
qqq9:1010:25FALSE316
qqq19:3220:35FALSE117
qqq21:5422:47FALSE118
qqq9:2810:34FALSE321
qqq12:3713:17FALSE122
qqq16:2217:05FALSE022

<tbody>
</tbody>

For example, we would only see the 22 in the last row an not the numbers above it.
 
Last edited by a moderator:
Upvote 0
Thank you. Is there a function that would be able to sum up the numbers in column E but only for when colomn A are the same. Therefor it would know to start counting column E from Zero again when Column A changes. Thanks for your help.

You can create a pivot table, where the row label is the information from column A and the value is the sum of column E
 
Upvote 0
that formula works. Thanks.

For a different format of the data that im working on i've been using this formula =SUMPRODUCT((B2<=$C$2:$C$45)*(C2>=$B$2:$B$45))>1 I used this formula to simply return a TRUE or FALSE Statement. Where the TRUE value indicates if it overlaps with any other cars in the lot. I was wondering if you could help me figure out how to edit this formula where when column A changes the formula knows to restart and look for overlaps in times at a different location (similar to what we did eailer). Below is the data where Column D represents if it is there overnight and Column E represents if it overlaps with another time.

Arvl Sta
A
Arvl Time
B
Dept Time
C
Is Overnight
D
Does Ovlap
E
zzz21:478:43TRUEFALSE
zzz19:3520:36FALSETRUE
zzz11:0111:56FALSETRUE
zzz14:2915:24FALSETRUE
zzz17:1518:04FALSETRUE
zzz21:0022:14FALSETRUE
zzz12:3513:20FALSETRUE
zzz15:2316:10FALSETRUE
zzz6:447:34FALSETRUE
zzz13:3014:15FALSETRUE
zzz19:0020:00FALSETRUE
zzz16:1716:57FALSETRUE
zzz7:388:45FALSETRUE
zzz11:3612:34FALSETRUE
zzz19:1120:49FALSETRUE
zzz9:1710:19FALSETRUE
zzz16:0416:59FALSETRUE
zzz17:4118:52FALSETRUE
zzz6:117:09FALSETRUE
zzz14:5015:40FALSETRUE
zzz14:4715:42FALSETRUE
zzz20:5022:25FALSETRUE
zzz13:4914:34FALSETRUE
zzz16:4317:29FALSETRUE
zzz19:3920:26FALSETRUE
zzz11:5913:00FALSETRUE
zzz9:009:40FALSETRUE
zzz11:3012:50FALSETRUE
zzz8:579:37FALSETRUE
zzz22:256:30TRUEFALSE
zzz19:1720:49FALSETRUE
zzz20:4421:46FALSETRUE
zzz15:5417:08FALSETRUE
zzz14:5015:52FALSETRUE
zzz14:2015:30FALSETRUE
zzz18:1319:00FALSETRUE
zzz15:4417:00FALSETRUE
zzz16:5918:15FALSETRUE
zzz11:2312:30FALSETRUE
zzz10:0011:05FALSETRUE
zzz18:5320:40FALSETRUE
zzz19:539:00TRUEFALSE
zzz8:4510:10FALSETRUE
zzz12:1013:25FALSETRUE

<tbody>
</tbody>
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,216,031
Messages
6,128,422
Members
449,450
Latest member
gunars

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