Counting number of observations within a date range?
If I understand your requirement:
in D3:
(I have assumed data starts in row 2 so change 2 to whatever in formula
below):
=SUMPRODUCT(--($B$2:$B$7=B2),--($C$2:$C$7<=C2))
Copy down as required
HTH
"Nic" wrote:
Hi,
I have two columns with dates in my dataset, which define
the start and end dates for a certain event. For each
observation in the dataset, I'd like to count the
number of other observations in the dataset that
overlap with this event window.
I.e.
Event Start date End date Simultaneous events
-----------------------------------------------------------------------------------
XYZ 11jan04 07feb04 ???
ZZZ 11jan04 08feb04 ???
YYY 14jan04 22jan04 ???
XXX 21jan04 13mar04 ???
ZZY 30jan04 04feb04 ???
aso.aso.
Many thanks for your help!
|