If you're starting with a list of dates and you want to know how many are
within the range 01/02/2007 through 01/31/2007 (inclusive),
you'll probably get SUMPRODUCT responses,
but lately I've developed a new respect for the FREQUENCY function as an
alternative.
With
A1:A100 containing dates
Try this...
B1: (the end date of the prev range....eg 01/01/2007)
C1: (the end date of the range you want....eg 01/31/2007)
This formula returns the number of cells in A1:A100 that are within the
range 01/02/2007 and 01/31/2007, inclusive.
E1: =INDEX(FREQUENCY(A1:A100,C1

1),2)
It works this way....
A1:A100 is the list of dates
C1

1 contains these dates
01/01/2007
01/31/2007
The FREQUENCY function returns an array of 3 values (in this case):
The number of cells that are <=01/01/2007
The number of cells that are >01/01/2007 and <=01/01/2007
The number of cells that are >01/31/2007
(you don't have to specify the last range...Excel assumes it's there and
uses it)
The INDEX function looks at array of 3 values and pulls the 2nd value
Example:
If A1:A100 only contains the list of dates from
12/15/2006 through 02/15/2007,
the FREQUENCY function returns this array: {18,30,15}
which is....
the 18 days prior to 01/02/2007,
the 30 days within 01/02/2007 thru 01/31/2007,
and the 15 days after 01/31/2007
In the example....the formula returns 30
You could also write the formula this way:
=INDEX(FREQUENCY(A1:A100,--{"01-Jan-2007","31-Jan-2007"}),2)
Does that help?
Post back with more questions.
***********
Regards,
Ron
XL2002, WinXP