XNPV function in Google Sheets
Calculates the net present value of an investment based on a specified series of potentially irregularly spaced cash flows and a discount rate.
=XNPV(discount, cashflow_amounts, cashflow_dates)XNPV syntax and parameters
Three arguments, three required.
- discountnumberRequired
The discount rate of the investment over one period.
- cashflow_amountsrangeRequired
A range of cells containing the income or payments associated with the investment.
- cashflow_datesrangeRequired
A range of cells with dates corresponding to the cash flows in cashflow_amounts.
XNPV examples
Formulas you'll actually reuse.
Present value of irregularly dated cash flows — dates in A, amounts in B, first row the outlay:
=XNPV(8%, B2:B8, A2:A8)A go/no-go from the sign of the NPV:
=IF(XNPV(8%, B2:B8, A2:A8) > 0, "Invest", "Pass")Result
"Invest"
XNPV in Excel
Same name — your formula ports as-is.
Try XNPV in the playground
Edit the example — nothing to install.
Preloaded with the XNPV formula from Example 1 — change anything and watch it respond.
XNPV errors
What they mean — and the fixes.
#NUM!A date is earlier than the first date — the first row must be the earliest cash flow.
Related functions
More ways Google Sheets gets this done.
- ACCRINTCalculates the accrued interest of a security that has periodic payments.FinancialExcel
- ACCRINTMCalculates the accrued interest of a security that pays interest at maturity.FinancialExcel
- AMORLINCReturns the depreciation for an accounting period, or the prorated depreciation if the asset was purchased in the middle of a period.FinancialExcel
- COUPDAYBSCalculates the number of days from the first coupon, or interest payment, until settlement.FinancialExcel
- COUPDAYSCalculates the number of days in the coupon, or interest payment, period that contains the specified settlement date.FinancialExcel
- COUPDAYSNCCalculates the number of days from the settlement date until the next coupon, or interest payment.FinancialExcel