beautypg.com

Datedif, 45 datedif – Apple iWork '09 User Manual

Page 45

background image

Chapter 3

Date and Time Functions

45

TIME” on page 56

“Listing of Date and Time Functions” on page 42

Value Types” on page 36

The Elements of Formulas” on page 15

“Using the Keyboard and Mouse to Create and Edit Formulas” on page 26

“Pasting from Examples in Help” on page 41

DATEDIF

The DATEDIF function returns the number of days, months, or years between two
dates.

DATEDIF(start-date, end-date, calc-method)

Â

start-date: The starting date. start-date is a date/time value.

Â

end-date: The ending date. end-date is a date/time value.

Â

calc-method: Specifies how to express the time difference and how dates in
different years or months are handled.
“D”: Count the number of days between the start and end dates.
“M”: Count the number of months between the start and end dates.
“Y”: Count the number of years between the start and end dates.
“MD”: Count the days between the start and end dates, ignoring months and years.
The month in end-date is considered to be the month in start-date. If the starting
day is after the ending day, the count starts from the ending day as if it were in the
preceding month. The year of the end-date is used to check for a leap year.
“YM”: Count the number of whole months between the start and end dates,
ignoring the year. If the starting month/day is before the ending month/day, the
dates are treated as though they are in the same year. If the starting month/day is
after the ending month/day, the dates are treated as though they are in consecutive
years.
“YD”: Count the number of days between the start and end dates, ignoring the
year. If the starting month/day is before the ending month/day, the dates are treated
as though they are in the same year. If the starting month/day is after the ending
month/day, the dates are treated as though they are in consecutive years.