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
?
[TABLE="width: 650"]
<tbody>[TR]
[TD]Arvl Sta[/TD]
[TD]Arvl Time[/TD]
[TD]Dept Time[/TD]
[TD]Is Overnight[/TD]
[TD]Does Ovlap[/TD]
[TD]Count Overlap[/TD]
[TD]Count Overnight unless Overlapped[/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]21:47[/TD]
[TD="align: right"]8:43[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]FALSE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]19:35[/TD]
[TD="align: right"]20:36[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]11:01[/TD]
[TD="align: right"]11:56[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]14:29[/TD]
[TD="align: right"]15:24[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]17:15[/TD]
[TD="align: right"]18:04[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]21:00[/TD]
[TD="align: right"]22:14[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]12:35[/TD]
[TD="align: right"]13:20[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]15:23[/TD]
[TD="align: right"]16:10[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]6:44[/TD]
[TD="align: right"]7:34[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]13:30[/TD]
[TD="align: right"]14:15[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]19:00[/TD]
[TD="align: right"]20:00[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]16:17[/TD]
[TD="align: right"]16:57[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]7:38[/TD]
[TD="align: right"]8:45[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]11:36[/TD]
[TD="align: right"]12:34[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]19:11[/TD]
[TD="align: right"]20:49[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]9:17[/TD]
[TD="align: right"]10:19[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]16:04[/TD]
[TD="align: right"]16:59[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]17:41[/TD]
[TD="align: right"]18:52[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]6:11[/TD]
[TD="align: right"]7:09[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]14:50[/TD]
[TD="align: right"]15:40[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]14:47[/TD]
[TD="align: right"]15:42[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]20:50[/TD]
[TD="align: right"]22:25[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]13:49[/TD]
[TD="align: right"]14:34[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]16:43[/TD]
[TD="align: right"]17:29[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]19:39[/TD]
[TD="align: right"]20:26[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]11:59[/TD]
[TD="align: right"]13:00[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]9:00[/TD]
[TD="align: right"]9:40[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]11:30[/TD]
[TD="align: right"]12:50[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]8:57[/TD]
[TD="align: right"]9:37[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]22:25[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]FALSE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]19:17[/TD]
[TD="align: right"]20:49[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]20:44[/TD]
[TD="align: right"]21:46[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]15:54[/TD]
[TD="align: right"]17:08[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]14:50[/TD]
[TD="align: right"]15:52[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]14:20[/TD]
[TD="align: right"]15:30[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]18:13[/TD]
[TD="align: right"]19:00[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]15:44[/TD]
[TD="align: right"]17:00[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]16:59[/TD]
[TD="align: right"]18:15[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]11:23[/TD]
[TD="align: right"]12:30[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]10:00[/TD]
[TD="align: right"]11:05[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]18:53[/TD]
[TD="align: right"]20:40[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]19:53[/TD]
[TD="align: right"]9:00[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: center"]FALSE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]8:45[/TD]
[TD="align: right"]10:10[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]zzz[/TD]
[TD="align: right"]12:10[/TD]
[TD="align: right"]13:25[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]TRUE[/TD]
[TD="align: right"]41[/TD]
[TD="align: right"]3[/TD]
[/TR]
</tbody>[/TABLE]