View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Calculate no. of Sundays in a month

On Thu, 19 Jun 2008 06:22:02 -0700, Sunnyskies
wrote:

Afternoon from RSA,

Adding on to this, how would you change the formula to not just be for
Sundays but for all other days in the week.

A1=Mon
A2=Tues
A3=Wed
A4=Thur
A5=Fri
A6=Sat
A7=Sun

Thanks


To generalize, a formula giving the number of specific weekdays in the range
from date to another (i.e. inclusive of the starting and ending dates) can be
given by:

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

where
A1: Start Date
A2: End Date
DOW: 1=Sunday; 2=Monday; etc
--ron