View Single Post
  #6   Report Post  
Myrna Larson
 
Posts: n/a
Default

On Tue, 29 Mar 2005 09:26:01 -0600, "Johnny" wrote:

Two facts: (1) DST always starts on the first Sunday in April and
(2) ...every year in the 21st century that's divisible by 4 (2004, 2008 . .

.. 2096) is a Leap Year

Yes, but your 2nd point isn't relevant since the time span of interest doesn't
include the end of February. As you say, the answer is either 203 or 210 days,
which can be determined by the day of the week on which April 1 falls.

If April 1 is a Monday, Tuesday, or Wednesday, DST is in effect for 203 days,
otherwise 210. So to answer your specific question, with the year (i.e. 2010
-- not a full date), in A1

=IF(WEEKDAY(DATE(A1,4,1),2)<4,203,210)

or

=203+7*(WEEKDAY(DATE(A1,4,1),2)3)

PS: I happened to choose April 1 as the date to check, but if you know the day
of the week for March 1, you can calculate the day of the week for any date
later in that year.