You are here: Function Reference > Alphabetical Listing > L > LeapYear

LeapYear

Use this function to find out whether or not the specified year is a leap year.

Syntax

LeapYear (Year)

Parameter

Description

Year

Enter the year. You can enter either a two- or four-digit number. If you enter a two-digit number, the current century is added to create the year value. The default is the current year.

The system returns one (1) if the year is a leap year and zero (0) if it is not.

This function is most often used with the Year function. The Year function extracts the year number from a given date.

Example

Here are some examples:

(Assume the current date is 07/01/08.)

Function

Result

Explanation

LeapYear ( )

1

The parameter defaults to the current year (2008). Since 2008 is a leap year, one (1), which represents true, is the result.

LeapYear (07)

0

The year 2007 was not a leap year. Therefore, the result is zero (0), representing false.

LeapYear (Year

("2009/09/09", "34") )

0

First the Year function extracts the year number (2009) from the date, which is given in the date format "34". Then LeapYear determines that 2009 is not a leap year and returns zero (0.)

See also