802 Chapter 33
33.3.4 Calculating the Diference between Two Dates: The Function Datedif
The Excel function Datedif computes the difference between two dates
in various useful ways:
1
2
3
4
5
6
7
8
9
10
11
AB C
Date1 3-Apr-47
Date2 22-Dec-02
Explanation
55 <
--
=DATEDIF(B2,B3,"y") Number of years between dates
668 <
--
=DATEDIF(B2,B3,"m") Number of months between dates
20352 <
--
=DATEDIF(B2,B3,"d") Number of days between dates
19 <
--
=DATEDIF(B2,B3,"md") Number of days in excess of full number of months
8<
--
=DATEDIF(B2,B3,"ym") Number of months in excess of full number of years
263 <
--
=DATEDIF(B2,B3,"yd") Number of days in excess of full number of years
DATEDIF COMPUTES DIFFERENCE BETWEEN TWO DATES
If Date1 is the author’s birth date and Date2 is today, then the author
is currently 55 years and 263 days old (cells A6 and A11).
33.4 The Functions XIRR and XNPV
The functions XIRR and XNPV calculate the internal rate of return
and the net present value for a series of cash fl ows received on
specifi c dates. They are especially useful for calculating IRR and NPV
when the dates are unevenly spaced.
2
If you do not have these functions,
you will have to activate Tools|Add-ins and then click on Analysis
ToolPak:
2. Excel’s IRR function assumes that the fi rst cash fl ow occurs today, the next cash
fl ow occurs one period hence, the following cash fl ow two periods hence, and so
on. Excel’s NPV function assumes that the fi rst cash fl ow occurs one period from
now, the next cash fl ow in two periods, and so on. We call this pattern “even
spacing of cash fl ows.” When this is not the case, you’ll need the XIRR and XNPV
functions.