XNPV Function
Calculates the net present value for a schedule of cash flows that is not necessarily periodic.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
| rate | Discount rate to apply to the cash flows. | Required |
| values | Series of cash flows corresponding to the dates. | Required |
| dates | Series of dates corresponding to the cash flows. | Required |
Basic Example
NPV for irregular cash flows
=XNPV(0.1, B2:B5, A2:A5)A2:A5 contains dates and B2:B5 contains the cash flows, discounted at 10%.
Advanced Examples
Example 1: Include initial investment
Project evaluationInitial investment is included in the values array on the first date
=XNPV(0.12, B2:B6, A2:A6)How XNPV Works
XNPV discounts each cash flow to the first date using the actual number of days between dates. The discount rate is annualized.
Important Notes & Limitations
Dates must be valid and the values array must match the dates array in length.
The initial investment is included in the values array, not added separately.
Uses a 365-day year for annualization.
Common Errors & Fixes
#VALUE! errorDates and values arrays have different lengths or dates are invalid.Fix: Ensure arrays match and dates are valid.
Wrong NPVInitial investment was added outside the formula.Fix: Include the initial investment in the values array with its date.
Download Practice File
XNPV
xnpvPractice XNPV with Real Data
Download a sample CSV file with pre-populated data and practice exercises for the XNPV function. Works in both Excel and Google Sheets.
File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps