Home » ExcelBuiltInFunctions » ExcelFinancialFunctions » ExcelXnpvFunction
The Excel XNPV Function
XNPV Function Equation
The Excel XNPV Function uses the following equation to calculate the net present value of an investment:
where,
d_{i} = the i'th payment date
d_{1} = the of 0'th payment date
P_{i} = the ith payment
Related Function:
NPV FunctionBasic Description
The Excel XNPV function calculates the Net Present Value for a schedule of cash flows that is not necessarily periodic.
The syntax of the function is:
XNPV( rate, values, dates )
Where the arguments are listed in the table below:
rate    The discount rate to apply to the cash flows. 
values    An array of numeric values, representing payments and income, where:  Negative values are treated as payments;
 Positive values are treated as income.
The first payment is optional and denotes a cost or payment at the beginning of the investment. 
dates    An array of dates corresponding to the array of payments. This array must be the same length as the supplied values array. 
XNPV Function Example
In the above spreadsheet on the right the Xnpv function is used to calculate the net present value of a series of cashflows.
The discounted rate is shown in cell B1 of the spreadsheet, the dates of the returns are stored in cells A2A7 and the values of the returns are stored in cells B2B7.
The syntax of the Xnpv function is shown in cell C10.
This function gives the result $4,449.60
Further information and examples of the Excel Xnpv function can be found on the Microsoft Office website.
XNPV Function Errors
If you get an error from the Excel Xnpv function this is likely to be one of the following:
Common Errors
#NUM!    Occurs if either:  The values and dates arrays have different lengths;
 any of the other dates are before the start date

#VALUE!    Occurs if either:  Any of the supplied rate or values arguments are nonnumeric
 any of the supplied dates are not recognised as dates by Excel

#NAME?    Occurs when Analysis ToolPak addin is not enabled in your Excel. You will need to enable the addin if you want to use the Excel Xnpv function.
+ Show How to Do This in Excel 2003:
 From the Tools dropdown menu, select the option AddIns ...
 An 'AddIns' window will pop up. From this, select the option Analysis ToolPak and click OK
+ Show How to Do This in Excel 2007:
 Click the Microsoft button on the top left of your spreadsheet and select
the Excel Options button
 From the menu on the left hand side, select AddIns
 In the 'Manage:' box, select Excel Addins and click Go...
 An 'AddIns' window will pop up. From this, select the option Analysis ToolPak and click OK
+ Show How to Do This in Excel 2010 or Excel 2013:
 Click the File tab (top left of your spreadsheet) and select Options
 From the menu on the left hand side, select AddIns
 If the window that pops up doesn't show the 'Addins' list, use the 'Manage:'
dropdown menu (at the bottom of the window) to select Excel Addins. Click Go...
 From the 'AddIns' window, select the option Analysis ToolPak and click OK
