XNPV
Calculates annualized net present value for irregularly dated cash flows.
Discounting uses an actual-day offset divided by 365 from the first provided date.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=XNPV(rate, values, dates)
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
rate | number | Required | — |
values | any | Required | — |
dates | any | Required | — |
Remarks
rateis an annual discount rate.- Cash-flow sign convention: outflows are negative and inflows are positive.
valuesanddatesare flattened to numeric entries; non-numeric entries are ignored.
Error cases
- Scalar error inputs are propagated; callable inputs return
#CALC!. - Returns
#NUM!whenvaluesanddateslengths differ or no numeric pair exists.
Examples
Discount the cash flows according to their actual dates.
Formula =XNPV(0.05,A1:A3,B1:B3)
| A | B | |
|---|---|---|
| 1 | -100 | =DATE(2024,1,1) |
| 2 | 60 | =DATE(2024,9,1) |
| 3 | 55 | =DATE(2025,5,1) |
Expected result 9.61515964938344
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Recalculate the value with the final cash flow removed.
Formula =XNPV(0.05,A1:A2,B1:B2)
| A | B | |
|---|---|---|
| 1 | -100 | =DATE(2024,1,1) |
| 2 | 60 | =DATE(2024,9,1) |
Expected result -41.9253837003986
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
A zero discount rate leaves the signed cash flows undiscounted.
Formula =XNPV(0,A1:A3,B1:B3)
| A | B | |
|---|---|---|
| 1 | -100 | =DATE(2024,1,1) |
| 2 | 60 | =DATE(2024,9,1) |
| 3 | 55 | =DATE(2025,5,1) |
Expected result 15
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Every cash flow needs a date in the corresponding position.
Formula =XNPV(0.05,A1:A3,B1:B2)
| A | B | |
|---|---|---|
| 1 | -100 | =DATE(2024,1,1) |
| 2 | 60 | =DATE(2024,9,1) |
| 3 | 55 |
Expected result #NUM!
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Discount four receipts spaced 365 days apart at an annual rate of 10%.
Formula =XNPV(0.10, {-10000,2750,4250,3250,2750}, {0,365,730,1095,1460})
Expected result 332.456799398946
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Discount three unequally spaced receipts at an annual rate of 8% and include the initial outlay.
Formula =XNPV(0.08, {-5000,1200,1800,2400}, {0,180,365,730})
Expected result -120.410787997008
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
How are dates interpreted in XNPV?
Each cash flow is discounted by (date_i - first_date) / 365, so dates must align one-to-one with values.