Function Problems

Calculate Excel NPER Using Its Mathematical Formula

Aamir Naveed AkramAamir Naveed Akram Nov 25, 2026 868 views

Question details

Find the mathematical formula Excel uses to calculate the number of payment periods with NPER.

Calculate Excel NPER Using Its Mathematical Formula
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants to understand or reproduce the NPER calculation for regular payments and a constant periodic interest rate.
Observed behavior
The desired result is the number of payment periods calculated from the rate, payment, present value, future value, and payment timing.
Before you start

Identify the interest rate per payment period, the payment amount, present value, future value, and whether payments occur at the beginning or end of each period. Use opposite signs for cash inflows and outflows, and convert an annual rate to a periodic rate when necessary.

Solution 1Recommended

Calculate NPER from the present-value equation

Use the logarithmic formula to reproduce NPER for a nonzero rate, or use the linear formula when the rate is zero.

For a nonzero periodic rate, NPER = LOG((PMT * (1 + RATE * (TYPE <> 0)) - FV * RATE) / (PV * RATE + PMT * (1 + RATE * (TYPE <> 0)))) / LOG(1 + RATE). The expression TYPE <> 0 evaluates to 1 for beginning-of-period payments and 0 for end-of-period payments.

When RATE is zero and PMT is nonzero, NPER = -(PV + FV) / PMT. Both formulas assume a constant rate and payment amount.

1
Enter the inputs

In an Excel worksheet, enter RATE in B1, PMT in B2, PV in B3, FV in B4, and TYPE in B5. For example, use 5%/12, -200, 10000, 0, and 0 for a monthly loan payment.

2
Calculate with NPER

Select an empty cell and enter =NPER(B1,B2,B3,B4,B5) to calculate the number of payment periods.

3
Check the underlying formula

In another empty cell, enter =IF(B1=0,-(B3+B4)/B2,LOG((B2*(1+B1*(B5<>0))-B4*B1)/(B3*B1+B2*(1+B1*(B5<>0))))/LOG(1+B1)). Compare the result with the NPER cell.

Calculate NPER from the present-value equation
Check for a valid result: The logarithmic expression requires valid positive logarithm arguments and a nonzero denominator. If the inputs do not describe a reachable balance, the calculation may return an error; when RATE is zero, PMT must also be nonzero.
Calculate payment periods in WPS

Use NPER in WPS Spreadsheet

Enter your loan or investment inputs in WPS Spreadsheet and use NPER to calculate the number of payment periods. You can also enter the logarithmic formula to inspect the calculation.

  1. 1. Open a spreadsheet: Open WPS Office, choose Spreadsheet, and create a blank workbook or open an existing Excel file.
  2. 2. Enter the inputs: Enter the periodic rate, payment, present value, future value, and payment type in cells B1 through B5, respectively.
  3. 3. Insert the function: Select an empty cell and enter =NPER(B1,B2,B3,B4,B5), then press Enter.
  4. 4. Save the workbook: Choose File > Save As and select Excel Workbook (.xlsx) if you want to share the calculation with Excel users.
Calculate payment periods with the NPER functionOpen and save Microsoft Excel XLSX and XLS filesCompare the built-in function with the underlying formulaWork in a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

What do the arguments in NPER represent?

In =NPER(rate,pmt,pv,[fv],[type]), rate is the interest rate per period, pmt is the regular payment, pv is the present value, fv is the target future value, and type specifies payment timing. Omitted fv and type default to 0.

How do I use an annual interest rate with monthly payments?

Convert the annual rate to a monthly rate in the rate argument. For example, enter =NPER(5%/12,-200,10000,0,0) for a 5% annual nominal rate and monthly payments.

Why should the payment and loan amount have opposite signs?

NPER follows cash-flow conventions: money received is positive and money paid out is negative. For a loan you receive, enter a positive present value and a negative payment.

What does the type argument change?

Use 0 or omit type for payments at the end of each period. Use 1 for payments at the beginning; the mathematical formula treats any nonzero type as beginning-of-period payments.

How is NPER calculated when the interest rate is zero?

With no interest and a nonzero payment, the number of periods is -(PV + FV) / PMT. In a worksheet, you can still use =NPER(0,pmt,pv,fv,type).