You can do it with this user defined function
Function RankSum(InRange, OutRange, RankRange, SegmentStartTime, SegmentMinutes)
For Each Cell In InRange
StartTime = Cell
FinishTime = Cell.Offset(0, OutRange.Column - InRange.Column)
If StartTime <= SegmentStartTime And FinishTime >= SegmentStartTime + (SegmentMinutes / (24 * 60)) Then
RankSum = RankSum + Cell.Offset(0, RankRange.Column - InRange.Column)
End If
Next Cell
End Function
Add this to a VBA module.
Next to your times column type a formula such as
=RankSum($B$2:$B$4,$C$2:$C$4,$D$2:$D$4,H2,30)
Bookmarks