@travishorn/financejs
    Preparing search index...

    Function calculateNetPresentValue

    • Calculates the net present value of an investment by using a discount rate and a series of future payments (negative values) and income (positive values).

      Remarks:

      • The NPV investment begins one period before the date of the first value in the cash flow and ends with the last value in the cash flow. The NPV calculation is based on future cash flows. If your first cash flow occurs at the beginning of the first period, the first value must be added to the NPV result, not included in the cash flows.
      • calculateNetPresentValue() is similar to the calculatePresentValue() function (present value). The primary difference between calculateNetPresentValue() and calculatePresentValue() is that calculatePresentValue() allows cash flows to begin either at the end or at the beginning of the period. Unlike the variable NPV cash flow values, PV cash flows must be constant throughout the investment.
      • calculateNetPresentValue() is also related to the calculateInternalRateOfReturn() function (internal rate of return). IRR is the rate for which NPV equals zero: calculateNetPresentValue({ rate: calculateInternalRateOfReturn(...), ... }) = 0.

      Parameters

      • options: NetPresentValueOptions

        The net present value calculation options.

      Returns number

      The net present value.

      When there are no cash flow values or rate is invalid.

      calculateNetPresentValue({
      rate: 0.1,
      cashFlows: [-10000, 3000, 4200, 6800],
      }); // 1188.443412335223
      calculateNetPresentValue({
      rate: 0.02,
      cashFlows: [-50000, 91332, 95379, 83519],
      }); // 205802.26736796144