Quantity of specific days within a time period.

G

Gary jones

Can Excel determine for me how many Mondays, Tuesdays, etc. fall
within a time period?
Example: How many Thursdays, and Saturdays fall between 8/10/03 and
11/15/03?
 
P

Peo Sjoblom

With 8/10/03 in A1 and 11/15/03 in A2

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&A2)),2)={4,6}))

or hard coded

=SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(--"08/10/03"&":"&--"11/15/03")),2)={4,6}
))
 
D

Daniel.M

Hi Gary,

A1: Initial date (10 Aug in yr ex)
A2: Final date (15 Nov)
DOW: (Sundays =1, Mondays=2, ..., Saturdays = 7)

=INT((A2-WEEKDAY(A2+1-DOW)-A1+8)/7)

So the number of Tuesdays is given by:
=INT((A2-WEEKDAY(A2-2)-A1+8)/7)

Got it?

Daniel M.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top