@travishorn/financejs
    Preparing search index...

    Function npv

    • 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 values arguments.
      • npv() is similar to the pv() function (present value). The primary difference between pv() and npv() is that pv() 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.
      • npv() is also related to the irr() function (internal rate of return). IRR is the rate for which NPV equals zero: npv(irr(...), ...) = 0.

      Parameters

      • rate: number

        The rate of discount over the length of one period.

      • ...values: number[]

        At least one value is required. Values must be equally spaced in time and occur at the end of each period. This function uses the order of the values to interpret the order of cash flows. Be sure to enter your payment and income values in the correct sequence.

      Returns number

      The net present value.

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

      npv(0.1, -10000, 3000, 4200, 6800); // 1188.44