Date Ranges

  • Thread starter Thread starter Bridget Stacy
  • Start date Start date
B

Bridget Stacy

Is there a function that will count the number of days in
a month for a date range? For instance, if I have a start
date of 1/1/2003 and an end date of 3/24/2003, is there a
function that will return the number of days in March for
that date range?
 
Bridget Stacy said:
Is there a function that will count the number of days in
a month for a date range? For instance, if I have a start
date of 1/1/2003 and an end date of 3/24/2003, is there a
function that will return the number of days in March for
that date range?

If your date 3/24/2003 were in A1,
=DAY(A1)
will return 24.
Or have I missed the point of your question?
 
one way:

With start date in A1, end date in A2:

=MIN(A2,DATE(2003,4,0))-MAX(A1-1,DATE(2003,3,0))

which you could generalize: if you put 3/2003 in D1, for example:

=MIN(A2,DATE(YEAR(D1),MONTH(D1)+1,0)) -
MAX(A1-1,DATE(YEAR(D1),MONTH(D1),0))
 
I have a very long list of date ranges (start dates and
end dates). If the start date is 1/1/2003 and the end
date is 12/17/2003, is there a formula that will calculate
how many days in November are included in that date range?
 
Back
Top