Counting dates using "more than"

J

Joey

Hi all

This is hard to explain so please bare with me
I would like to count in a column with dates.

The formula should count or group the periods when the gap between th
dates are more than 3. (days)

1-May-04
4-May-04
5-May-04
6-May-04
7-May-04
11-May-04
14-May-04
15-May-04
19-May-04

In other words;
1,4,5,6,7 is one period
11,14,15 is another
and 19 is another

With the total being 3

Thanks in advance
Joey:confused
 
J

Jason Morin

Assuming the dates are always in sequential order and the
range of dates in this case is A1:A9:

=IF(SUMPRODUCT(--(A2:A10-A1:A9>3))>0,SUMPRODUCT(--(A2:A10-
A1:A9>3))+1,0)

HTH
Jason
Atlanta, GA
 
Top