Determining whether a year is a leap year

To determine whether a particular year is a leap year, you can write a formula that determines whether the twenty-ninth day of February occurs in February or March. You can take advantage of the fact that Excel’s DATE function adjusts the result when you supply an invalid argument—for example, a day of 29 when
February contains only 28 days.

The following formula returns TRUE if the year of the date in cell A1 is a leap year. Otherwise, it returns FALSE.

=IF(MONTH(DATE(YEAR(A1),2,29))=2,TRUE,FALSE)

This function returns the wrong result (TRUE) if the year is 1900. See the section “Excel’s leap year bug,” earlier in this chapter.

Add to Technorati Favorites


// Related Posted - GOOGLE!

Loading



Related Websites
No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>