Skip to content

NPER

Returns the number of periods needed to repay a loan or reach a savings goal, for a constant payment and interest rate.

Syntax

=NPER(, , , , )

Financial

All versions of Excel.

Try it

Edit the formula in B4 or change the inputs. The sheet recalculates as you type.

B4
A
B
C
1
Loan amount
20,000
2
Annual rate
5.0%
3
Monthly payment
500
4
Months needed
43.85
5

B4 =ROUND(NPER(B2/12,-B3,B1),2) returns 43.85

How NPER works

NPER answers "how long will it take?". It returns the number of payment periods needed to clear a loan or build a balance when the rate and payment stay constant. =NPER(5%/12,-500,20000) returns 43.85: paying 500 a month on a 20,000 loan at 5% a year takes about 43.85 months. The periods are in whatever unit your rate uses, so for a monthly rate the answer is in months.

Sign convention: cash out is negative

Excel treats money you receive as positive and money you pay as negative. A loan you receive is positive, and the payments are cash out, so enter them as negative: -500. If pv and pmt have the same sign, there is no solution, and NPER returns a wrong or unusable result, often #NUM!. For savings, the deposits are negative and the target balance is positive: =NPER(4%/12,-300,0,50000) returns about 132.8 months.

The arguments

  • rate is per period. Divide a yearly rate by 12 for monthly payments.
  • pmt is the regular payment. It must be larger than the interest charged each period, otherwise the balance never falls and NPER returns #NUM!.
  • pv is the loan amount or opening balance.
  • fv is the balance at the end. It defaults to 0.
  • type is 0 for payments at the end of each period and 1 for payments at the start.

The answer is rarely whole

NPER returns the exact number of periods, which is usually a fraction, because the last payment is smaller. For a whole number of payments, round up: =ROUNDUP(NPER(5%/12,-500,20000),0) is 44. The 44th payment is smaller than 500. Divide by 12 for years: =NPER(...)/12.

Patterns

  • Months to clear a debt: =ROUNDUP(NPER(rate/12,-payment,balance),0).
  • Years to reach a savings goal: =NPER(rate/12,-deposit,0,goal)/12.
  • Payoff date: =EDATE(TODAY(),ROUNDUP(NPER(rate/12,-payment,balance),0)).
  • Effect of paying more: compare NPER at two payment levels to see the months saved.
  • Time to double money: =NPER(rate,0,-1,2) for a rate per year.

Related functions

NPER is the "n" in the financial five: PMT finds the payment, PV the loan, FV the future balance, RATE the rate. Each takes the same arguments, so you can solve for whichever is unknown.

NPER assumes a constant rate and equal payments. It ignores fees and changes in rate.

Arguments

rate
The interest rate for each period, not for the year. For monthly payments on a 5% a year loan, use 5%/12.
pmt
The payment made each period. Money you pay out is negative, so a payment of 500 is entered as -500. It must be large enough to cover the interest.
pv
The present value: the loan amount today, or the starting balance for savings.
fvoptional
The balance you want after the last payment. Leave it out, or use 0, for a loan that is fully repaid. For a savings goal, enter the target as a positive number and set pv to 0.
typeoptional
0 or omitted: payments are made at the end of each period. 1: payments are made at the start of each period.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Months to repay a loan

B4 =ROUND(NPER(B2/12,-B3,B1),2)

Result: 43.85

The payment is negative because it is cash out. It takes 43.85 months, which means 43 full payments and a smaller 44th.

B4
A
B
C
1
Loan amount
20,000
2
Annual rate
5.0%
3
Monthly payment
500
4
Months needed
43.85
5

B4 =ROUND(NPER(B2/12,-B3,B1),2) returns 43.85

Example 2

Whole payments needed

B4 =ROUNDUP(NPER(B2/12,-B3,B1),0)

Result: 44

ROUNDUP turns 43.85 into 44 payments, because you can't make a part payment on the calendar.

B4
A
B
C
1
Loan amount
20,000
2
Annual rate
5.0%
3
Monthly payment
500
4
Payments
44
5

B4 =ROUNDUP(NPER(B2/12,-B3,B1),0) returns 44

Example 3

Months to reach a savings goal

B4 =ROUND(NPER(B2/12,-B3,0,B1),1)

Result: 132.8

Present value is 0 and the future value is the goal. The deposit is negative. 132.8 months is about 11 years.

B4
A
B
C
1
Goal
50,000
2
Annual rate
4.0%
3
Monthly deposit
300
4
Months needed
132.8
5

B4 =ROUND(NPER(B2/12,-B3,0,B1),1) returns 132.8

Example 4

Payment too small: the debt never clears

B4 =IFERROR(NPER(B2/12,-B3,B1),"Payment too low")

Result: Payment too low

Interest on 20,000 at 5% is about 83 a month, so a payment of 50 never reduces the balance. NPER returns #NUM!, which IFERROR replaces with a message.

B4
A
B
C
1
Loan amount
20,000
2
Annual rate
5.0%
3
Monthly payment
50
4
Result
Payment too low
5

B4 =IFERROR(NPER(B2/12,-B3,B1),"Payment too low") returns Payment too low

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In B5, return the exact number of months needed to repay the loan.

Answer in B5.

B5
A
B
C
1
Loan amount
20,000
2
Annual rate
5.0%
3
Monthly payment
500
4
5
Months (exact)
6
Payments (whole)
7
8

Common mistakes

  • Giving pmt and pv the same sign. A loan received is positive, and payments made are negative. With matching signs the result is wrong or an error.
  • A payment smaller than the interest charged each period returns #NUM!, because the balance never falls. Check the payment first, or wrap the formula in IFERROR.
  • Using the yearly rate with monthly payments. Divide by 12, or the answer is in the wrong units and about twelve times too small.
  • The result is fractional. Round up with ROUNDUP for whole payments, and divide by 12 if you want years.
  • The answer is in the same unit as the rate: months for a monthly rate, years for a yearly rate.

Questions people ask

How do I calculate how many months it takes to pay off a loan?

Use `=NPER(annual_rate/12, -payment, loan)`. Round up with ROUNDUP for a whole number of payments.

Why does NPER return #NUM!?

Most often the payment doesn't cover the interest, or the signs of pmt and pv are the same. Raise the payment or check the signs.

How do I find how long it takes to save a target amount?

Use `=NPER(rate/12, -deposit, 0, target)`. The result is in months. Divide by 12 for years.

Why is the result a decimal?

NPER gives the exact length, and the last payment is smaller than the others. 43.85 means 43 full payments and a smaller 44th.

Can I use NPER for yearly payments?

Yes. Use the yearly rate and yearly payment, and the answer is in years.

Learn NPER in a real sheet.

NPER is taught in Dates and financial modelling, lesson 12: CAGR and doubling time. Each lesson is a short, graded exercise like the one above.