# NPER
URL: https://docs.valsight.ai/nper/
Description: Calculates the number of periods needed for a recurring investment, given an interest rate, periodic payment, and present value.
**Category:** [Finance functions](/finance-functions/)

## Overview

The **NPER** function **calculates the number of periods necessary for a recurring investment** based on an interest rate, the amount of payment per period, a present value, a future value, and either ordinary annuity or annuity due (`"Type"`) indicating whether payments are due at the beginning or the end of the period.

Use this function when the rate and periodic payment are known and you want to calculate how many periods are needed.

## Syntax

`NPER('Rate', 'Pmt', 'Pv' [, 'Fv' [, "Type"]])`

## Parameters

| Parameter | Description                                                                                                                                                       | Type           | Required | Default |
| --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | -------- | ------- |
| **Rate**  | The interest rate.                                                                                                                                                | Node reference | Yes      | --      |
| **Pmt**   | Payment per period: the amount of each payment made. Payments/costs should ideally be entered as a negative number, for example `-100`, but this is not required. | Node reference | Yes      | --      |
| **Pv**    | Present value: the current value of the annuity.                                                                                                                  | Node reference | Yes      | --      |
| **Fv**    | Future value remaining after the final payment has been made.                                                                                                     | Node reference | No       | `0`     |
| **Type**  | Indicates when payments are due (`1` = payment at beginning of period / annuity due, `0` = payment at end of period / ordinary annuity).                          | Keyword        | No       | `0`     |

## Watch out

* `'Pv'` is the leading input node: its levels define the result's shape, and every other input is aligned to it.
* Every other input may use only levels that also exist on `'Pv'`. It may use fewer levels, but not a level that `'Pv'` does not have.
* `'Pmt'` is the exception: it must have exactly the same levels as `'Pv'`.
* On the levels it shares with `'Pv'`, each input must cover the same level values, otherwise the rows do not line up and the function returns an error.
* Each input can also be a single number.
* Giving every input the same levels as `'Pv'` skips an internal alignment step and improves performance.
* If costs or payments are entered as positive numbers in your model, multiply the result by `(-1)`.

## Example

### Calculate the required number of periods

This example shows a standard annuity setup with a monthly interest rate, a fixed payment, and a present value.
It returns the number of periods needed until the remaining value reaches the specified future value.

| Parameter                                                                                                     | Value    |
| ------------------------------------------------------------------------------------------------------------- | -------- |
| `Rate`  (Interest Rate)                                                                                       | 0.045/12 |
| `Pmt`  (Payment per Period - Amount)                                                                          | -100     |
| `Pv`  (Present value)                                                                                         | 5000     |
| `Fv`  (Future value)                                                                                          | 0        |
| `Type`<br>Payment at Beginning of Period (Annuity Due) = 1<br>Payment at End of Period (Ordinary Annuity) = 0 | 0        |

**Formula:** `NPER('Rate', 'Pmt', 'Pv', 'Fv', "Type")`

| NPER Result |
| ----------- |
| 55.47       |

## Related

| Function       | When to use instead                                                                 |
| -------------- | ----------------------------------------------------------------------------------- |
| [RATE](/rate/) | When the number of periods is known and you want the implied interest rate instead. |
| [PMT](/pmt/)   | When the duration is known and you want to calculate the periodic payment instead.  |
