Apple iWork '09 User Manual

Page 46

Advertising
background image

Examples

If A1 contains the date/time value 4/6/88 and A2 contains the date/time value 10/30/06:
=DATEDIF(A1, A2, “D”) returns 6781, the number of days between April 6, 1988, and October 30, 2006.
=DATEDIF(A1, A2, “M”) returns 222, the number of whole months between April 6, 1988, and October
30, 2006.
=DATEDIF(A1, A2, “Y”) returns 18, the number of whole years between April 6, 1988, and October 30,
2006.
=DATEDIF(A1, A2, “MD”) returns 24, the number of days between the sixth day of a month and the
thirtieth day of the same month.
=DATEDIF(A1, A2, “YM”) returns 6, the number of months between April and the following October in
any year.
=DATEDIF(A1, A2, “YD”) returns 207, the number of days between April 6 and the following October
30 in any year.
=DATEDIF(”04/06/1988”, NOW(), “Y”) & “ years, “ & DATEDIF(”04/06/1988”, NOW(), “YM”) & “ months, and
“ & DATEDIF(”04/06/1988”, NOW(), “MD”) & “ days” returns the current age of someone born on April 6,
1988.

Related Topics
For related functions and additional information, see:

“DAYS360” on page 49

“NETWORKDAYS” on page 54

“NOW” on page 55

“YEARFRAC” on page 63

“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

46

Chapter 3

Date and Time Functions

Advertising