XNPV function
The XNPV function in Excel calculates the net present value (NPV) of cash flows that occur at irregular intervals. Unlike the standard NPV function, which assumes equal periods between cash flows, XNPV accounts for actual dates.
Syntax:
XNPV(rate, values, dates)
Arguments:
- rate: The discount rate (as a decimal or percentage) used to calculate the present value of the cash flows.
- values: An array of cash flows. The first value is typically negative (representing an initial investment or outflow), and subsequent values are positive (inflows or returns).
- dates: An array of dates corresponding to the cash flows. These must match the order of the
valuesarray.
Formula:
The XNPV is calculated as:
Where:
is the first date in the series (base date).
is the date of the
-th cash flow.
Example:
Suppose you have the following cash flow data:
| Date | Cash Flow |
|---|---|
| 01/01/2023 | -10,000 |
| 04/01/2023 | 2,000 |
| 07/01/2023 | 4,000 |
| 12/01/2023 | 6,000 |
Formula:
=XNPV(10%, B2:B5, A2:A5)
Where:
10%is the discount rate.B2:B5contains the cash flows.A2:A5contains the corresponding dates.
Result:
The result will be the net present value of these cash flows discounted at an annual rate of 10%.
Key Points:
- XNPV vs. NPV: Use XNPV when cash flows are irregular; use NPV when cash flows occur at regular intervals.
- The function assumes a 365-day year for date calculations.
- At least one positive and one negative cash flow is required.