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:
So you want the same formula he made before except you want it to say true or false instead of the number of overlaps?

=IF(IF(D2=FALSE,SUMPRODUCT(--(ROW(A$2:A$400)<>ROW(A2)),--(A$2:A$400=A2),--(A$2:A$400<>""),--(D$2:D$400=FALSE),1-((B2>C$2:C$400)+(B$2:B$400>C2))),0)>0,TRUE,FALSE)
 
Last edited by a moderator:
Upvote 0

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
So you want the same formula he made before except you want it to say true or false instead of the number of overlaps?

=IF(IF(D2=FALSE,SUMPRODUCT(--(ROW(A$2:A$400)<>ROW(A2)),--(A$2:A$400=A2),--(A$2:A$400<>""),--(D$2:D$400=FALSE),1-((B2>C$2:C$400)+(B$2:B$400>C2))),0)>0,TRUE,FALSE)

This works for most of my data. Is there a SUMIF function I can use that would add up the total number of times TRUE appears from the function we just used. This new function would be very similar to the SUMIF function used when counting the numbers that we had used before. This new function would need to be able to distingush when Column A changes and only puts out the find SUM number on the last row before Column A changes.
 
Upvote 0
This works for most of my data. Is there a SUMIF function I can use that would add up the total number of times TRUE appears from the function we just used. This new function would be very similar to the SUMIF function used when counting the numbers that we had used before. This new function would need to be able to distingush when Column A changes and only puts out the find SUM number on the last row before Column A changes.

Have you seen the formula in post 28?

M.
 
Upvote 0
Sorry, i misread your post

Try in F2 copied down
=IF(A2<>A3,SUMPRODUCT(--(A$2:A$500=A2),--E$2:E$500),"")

M.
 
Upvote 0
Sorry, i misread your post

Try in F2 copied down
=IF(A2<>A3,SUMPRODUCT(--(A$2:A$500=A2),--E$2:E$500),"")

M.

The purpose of this function would be to SUM the total TRUE statements in D, but only when E reads FALSE. I copied the above fourmula and it returned #VALUE !.
 
Upvote 0
The purpose of this function would be to SUM the total TRUE statements in D, but only when E reads FALSE. I copied the above fourmula and it returned #VALUE !.

Do you want to sum (count) the TRUE statements in column D or in column E? I'm confused.

M.
 
Upvote 0
the purpose of this function would be to sum the total true statements in d, but only when e reads false. I copied the above fourmula and it returned #value !.

Column E
=IF(IF(D45=FALSE,SUMPRODUCT(--(ROW(A$2:A$400)<>ROW(A45)),--(A$2:A$400=A45),--(A$2:A$400<>""),--(D$2:D$400=FALSE),1-((B45>C$2:C$400)+(B$2:B$400>C45))),0)>0,TRUE,FALSE)

Column F
=IF(A2=A3,"",COUNTIFS(A:A,A2,E:E,TRUE))

Column G
=if(a2=a3,"",countifs(a:a,a2,d:d,true,e:e,false))

Is this what you want to have the count of the overlaps for Arvl Sta in column F
and to have the count of the overnights, when not overlapped for Arvl Sta in column G
?


Arvl StaArvl TimeDept TimeIs OvernightDoes OvlapCount OverlapCount Overnight unless Overlapped
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:25FALSETRUE413

<tbody>
</tbody>
 
Last edited by a moderator:
Upvote 0
Do you want to sum (count) the TRUE statements in column D or in column E? I'm confused.

M.

I want to SUM (count) the TRUE statements in E but only when the valu along the same row in column D is FALSE. I understand that in the table abv Column D is all false however for some of my other data there are some True statements in Column D.

Sorry for the confusion, appreciate your help.
 
Upvote 0
I want to SUM (count) the TRUE statements in E but only when the valu along the same row in column D is FALSE. I understand that in the table abv Column D is all false however for some of my other data there are some True statements in Column D.

Sorry for the confusion, appreciate your help.

Check the 3 formulas in my previous post, and tell me if that's waht you want.

Also, there is already a condition in column E for not including falses: D2=FALSE in your long formula so there won't be a situation where E says true and D says true so really all you need is a count if for the trues and falses in each column
 
Last edited:
Upvote 0

Forum statistics

Threads
1,217,265
Messages
6,135,544
Members
449,946
Latest member
Axdby

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