---
url: /cube-functions/nper.md
description: >-
  Returns the total number of payment periods in an annuity based on periodic,
  constant payments and future value.
---

# NPER

Returns the total number of payment periods in an annuity based on periodic, constant payments and future value.

```js
NPER(rate, pmt, pv, fv, type)
```

#### Parameters

* `rate` - The interest rate per period.
* `pmt` - The payment made each period; payments are assumed to be made at the end of each period.
* `pv` - The present value, or the total amount that a series of future payments is worth now.
* `fv` - The future value, or a cash balance that you want to attain after the last payment is made. If fv is omitted, it is assumed to be 0 (the future value of a loan, for example, is 0). `(optional)`
* `type` - The number 0 or 1 and indicates when payments are due. If type is omitted, it is assumed to be 0. `(optional)`

#### Examples

```js
NPER(0.075 / 12, -200, 8000)
```

**Result:** `46.173`

**Note:** Calculates the number of months it takes to pay off a loan with a $200 monthly payment, 7.5% monthly interest rate, and a $8,000 loan amount.
