Excel Tip: Determining the Remaining Length of a Loan Using NPER

By David Ringstrom, CPA

Previously I’ve explained how you can use worksheet functions in Excel to determine the payment for a loan, as well as how to calculate total interest in a single worksheet cell. This time around I’m going to use the NPER function in Excel to show you how you can determine just how long it will take you to payoff that credit card bill on which you’re making monthly payments.

You can get a refresher on the PMT and CUMIPMT functions, but any typical loan has four key values:

  • Interest rate
  • Term of loan
  • Amount borrowed
  • Monthly payment

As discussed in my previous article, if you have the interest rate, term, and loan amount, you can then use the PMT function to solve for the payment. Sometimes, such as with a credit card balance, you’ll know the interest rate, payment, and loan amount, but not the term.  In this case, Excel’s NPER function (short for number of periods) enables you to calculate the fourth value.

NPER has 3 required and 2 optional arguments:


rate - The interest rate for the loan expressed as a monthly rate.

pmt - The monthly payment, which should always be shown as a negative amount.

pv - The current loan balance

fv - This optional argument allows you to specify a future value if a balloon amount is due at the end of the loan. Omitting this argument implicitly states that the loan is to be paid down to 0.

type - This optional argument allows you to specify if payments are made at the beginning of each period, or you can omit the argument to indicate that payments are made at the end of each period. You may also specify 0 in this position to explicitly indicate that payments are made at the end of each period.


As shown in Figure 1, it will take 36 months to pay back $20,000 with a monthly payment of $586.04 at an interest rate of 3.5 percent. Always be sure that the payment is shown as a negative number, otherwise NPER may show a slightly longer payment term. I omitted the 2 optional arguments, so in this case, the PMT function assumes the loan is paid to 0 and payments are made at the end of each period.

Figure 1:
Use Excel’s NPER function to calculate the payment term for a loan.

For longer term loans, NPER may return a large number of months, such as 94, which can be difficult to convert to months in your head. Let’s extend our calculations to make the output more user-friendly.

First, as shown in Figure 2, we’ll add the ROUNDUP function to our NPER formula. Loan periods will typically involve some fraction of the final month, which for our purposes we want to treat as a whole month. The ROUNDUP function rounds a number up, as opposed to the commonly used ROUND function that may round numbers up or down.

ROUNDUP has two arguments:

number – In this case the result of NPER will be our number

num_digits – in this case we’ll use zero, as we wish to round up to the next whole month. If you wanted to round a number to say the nearest thousand, you’d use -3 instead.

Figure 2:
Use the ROUNDUP function with the NPER formula to convert to months.

Next, we need to convert the result that ROUNDUP/NPER return into a number of years and months. To do so, we can use the TRUNC function. This function converts a number to an integer by removing the decimal or fractional portion. You could also use ROUNDDOWN and specify zero as the number of digits to accomplish the same effect.

To calculate the number of whole years in the loan, we can use this formula:


Or this would work as well:


In either case we’re taking the number of periods returned by NPER, dividing it by 12, and then truncating the decimal places.

Use this formula to calculate the number of months remaining after the whole years:


We can then string all of this together into a tidy format, as shown in Figure 3:

="months, or "&TRUNC(B4/12)& " Years, "&ROUNDUP(B4-TRUNC(B4/12)*12,0)&" Months"

In this we’re using the ampersand to concatenate, or join together, text and calculations into an understandable phrase. I much prefer using the ampersand to join text together, but if you’re a fan of Excel’s CONCATENATE function, the formula would take this form:

=CONCATENATE("months, or ",TRUNC(B4/12), " Years, ",ROUNDUP(B4-TRUNC(B4/12)*12,0)," Months")

Figure 3:
Use the ampersand sign to concatenate text and calculations into a logical phrase.

Read more articles by David Ringstrom. 
About the author:

David H. Ringstrom, CPA heads up Accounting Advisors, Inc., an Atlanta-based software and database consulting firm providing training and consulting services nationwide. Contact David at david@acctadv.com or follow him on Twitter. David speaks at conferences about Microsoft Excel, and presents webcasts for several CPE providers, including AccountingWEB partner CPE Link.

You may like these other stories...

In the old days, we used to tape down receipts from our travels and submit them to accounts payable. But that was before remote employees who may live in a different city from the home office. And of course, there's all...
In 2011, electrical services and technology provider Parsons Electric in Minneapolis, Minn., decided to take its accounting to the cloud. Monica Ross, the company's director of strategic projects, talked with AWEB about...
Event Date: July 24, 2014, 2 pm ET In this presentation Excel expert David Ringstrom, CPA revisits the Excel feature you should be using, but probably aren't. The Table feature offers the ability to both boost the...

Upcoming CPE Webinars

Jul 16
Hand off work to others with finesse and success. Kristen Rampe, CPA will share how to ensure delegated work is properly handled from start to finish in this content-rich one hour webinar.
Jul 17
This webcast will cover the preparation of the statement of cash flows and focus on accounting and disclosure policies for other important issues described below.
Jul 23
We can’t deny a great divide exists between the expectations and workplace needs of Baby Boomers and Millennials. To create thriving organizational performance, we need to shift the way in which we groom future leaders.
Jul 24
In this presentation Excel expert David Ringstrom, CPA revisits the Excel feature you should be using, but probably aren't. The Table feature offers the ability to both boost the integrity of your spreadsheets, but reduce maintenance as well.