Spreadsheet finance functions: PV, FV, PMT, RATE, NPV and XIRR
The handful of spreadsheet functions that do most of finance's time-value maths: PV, FV, PMT, NPER and RATE for loans and savings, NPV and IRR for regular cash flows, and XNPV and XIRR for real cash flows on actual dates. The sign rule that trips everyone up; a home loan, NPV's one-period trap and a SIP's XIRR, worked step by step; and how RATE uncovers the true cost of a loan with fees, the annual percentage rate the RBI's Key Fact Statement rules now make lenders show.
Facts reviewed Oct 2026
The Maths of Money taught compounding, EMIs and SIPs by hand. In practice, finance professionals use a few spreadsheet functions for this. They work the same way in Excel, Google Sheets and LibreOffice.
(Financial Modelling covered how to lay out a spreadsheet. This module is about the tools themselves, first in spreadsheets, then in Python.)
It starts with the time-value functions: the ones that move money through time.
The five time-value functions
All five share the same arguments (the inputs inside the brackets):
- rate: the interest rate per period. A monthly rate is the yearly rate ÷ 12.
- nper: the number of periods.
- pmt: the payment each period.
- pv: present value, the amount today.
- fv: future value, the amount at the end.
- type: 0 if payments come at the end of each period (the default), 1 if at the start.
| Function | Answers | Example |
|---|---|---|
=PMT(rate, nper, pv) | The EMI on a loan | =PMT(9%/12, 240, -5000000) |
=FV(rate, nper, pmt) | What a SIP grows to | =FV(12%/12, 240, -10000) |
=PV(rate, nper, pmt) | What future payments are worth today | =PV(7%, 20, -100000) |
=NPER(rate, pmt, pv) | How many payments repay a loan | =NPER(9%/12, -45000, 5000000) |
=RATE(nper, pmt, pv) | The interest rate behind a loan | =RATE(60, -21000, 1000000)*12 |
Each function solves for one of the five numbers, given the other four. If you know any four, the spreadsheet finds the fifth.
The sign rule
Spreadsheets treat money going out as negative, and money coming in as positive, from your point of view.
- A ₹50 lakh loan you receive is positive: +5,000,000.
- The EMIs you pay are negative.
So =PMT(9%/12, 240, 5000000) returns a negative EMI. Many people enter the loan as negative, as in the table, to get a positive EMI.
Getting signs wrong is the commonest error. RATE and NPER return an error if all the cash flows have the same sign. No interest rate can make “money in” balance more “money in”.
Why does =RATE(60, 21000, 1000000) return an error?
Borrowing ₹10 lakh (positive) must be matched by payments going out (negative). With both positive, no interest rate can balance them.
A loan in one formula
Worked example. A ₹50 lakh home loan at 9% a year over 20 years.
- Monthly rate: 9% ÷ 12 = 0.75%.
- Number of payments: 20 × 12 = 240.
- EMI:
=PMT(9%/12, 240, -5000000)= about ₹44,986. - Total paid: ₹44,986 × 240 = about ₹1.08 crore.
- Interest: ₹1.08 crore − ₹50 lakh = about ₹58 lakh.
And going the other way: =NPER(9%/12, -45000, 5000000) gives about 240 months. Pay ₹45,000 a month and the loan takes 20 years. (Loans, Credit Scores & Debt explains how each EMI splits into interest and principal.)
Payments at the end of each period (type 0). The defaults: an EMI of about ₹44,986, ₹1.08 crore paid in total, and about ₹58 lakh of interest. A ₹10,000 monthly SIP at 12% for 20 years reaches about ₹99 lakh with FV's end-of-period rule.
A real case: the true cost of a loan with fees
Since 1 October 2024, the RBI has required lenders to give retail and small-business borrowers a Key Fact Statement (KFS). It must show the annual percentage rate (APR): the loan’s true yearly cost, including fees, not just the headline interest rate.
You can work out an APR yourself with RATE.
Worked example. A ₹5 lakh personal loan at 12% for 3 years, with a ₹10,000 processing fee taken from the loan.
- EMI on the full ₹5 lakh:
=PMT(1%, 36, -500000)= about ₹16,607. - Money you actually receive: ₹5 lakh − ₹10,000 = ₹4,90,000.
- True monthly rate:
=RATE(36, -16607, 490000)= about 1.12%. - APR: 1.12% × 12 = about 13.4% a year.
The fee adds about 1.4 points to the cost. RATE finds it in one line, because it asks: what interest rate makes these EMIs exactly repay the money I really got?
NPV and IRR: regular cash flows
=NPV(rate, value1, value2, …)discounts a series of cash flows one period apart. But it treats the first value as one period from now.=IRR(values)finds the rate that makes the NPV of the series zero. (Corporate Finance Fundamentals uses it for project decisions.)
Worked example: NPV’s one-period trap. A project costs ₹1 lakh today and returns ₹30,000, ₹40,000 and ₹60,000 over the next three years. The discount rate is 10%. The cash flows are in cells B1 to B4.
- Right way:
=NPV(10%, B2:B4) + B1. The future flows are discounted, and today’s −₹1 lakh is added as it is. Result: about +₹5,410. - Wrong way:
=NPV(10%, B1:B4). Now today’s cost is treated as if it came a year from now. Result: about +₹4,918, about 9% too low. - IRR:
=IRR(B1:B4)gives about 12.7%. It’s above the 10% discount rate, which agrees with a positive NPV.
XNPV and XIRR: real dates
Real cash flows don’t arrive on neat yearly dates. SIP instalments, dividends, top-ups and withdrawals happen on specific days. XIRR uses the actual dates:
=XIRR(values, dates)
It returns a yearly rate that allows for exactly how long each rupee was invested. It’s the right way to measure your own returns on a portfolio with irregular investments. (Institutional Investing & Asset Management calls this the money-weighted return.) XNPV(rate, values, dates) is the matching present-value function.
A typical XIRR table has dates in one column and amounts in the next. Each investment is negative. The portfolio’s current value goes in as a final positive amount, dated today.
Worked example. You invested ₹10,000 a month for 36 months: ₹3.6 lakh in all. Today the portfolio is worth ₹4.68 lakh, a gain of 30%.
- Simple sum: 30% over three years looks like about 10% a year.
- But the first ₹10,000 was invested for three years, and the last for just one month. On average, your money was invested for only about 18 months.
- XIRR allows for this, and gives about 17.8% a year.
Going further: how RATE and IRR find their answer. There’s no formula that solves for a rate directly. So spreadsheets guess, and improve the guess. They try a rate, see whether the NPV is above or below zero, and adjust, repeating until the answer stops changing. (A common method is Newton’s method.) That’s why RATE and IRR take an optional guess argument, and why they sometimes fail with #NUM!. It also explains a trap. Suppose the cash flows change sign more than once: an investment, then income, then a big repair bill. Then there can be two or more rates that make NPV zero. IRR returns just one, with no warning. For such projects, trust NPV.
Common mistakes
- Mixing yearly and monthly figures. Divide the rate by 12 and multiply the years by 12.
- Getting the signs wrong. Money in is positive, money out negative.
- Putting today’s flow inside NPV. Add it outside.
- Using IRR or a simple gain for SIPs. Use XIRR with real dates.
- Comparing loans on the headline rate. Use RATE, or the KFS’s APR, to include fees.
Practice 1: What's the EMI on a ₹30 lakh loan at 10.5% over 15 years? How much of what you pay is interest?
- Monthly rate: 10.5% ÷ 12 = 0.875%. Payments: 15 × 12 = 180.
- EMI:
=PMT(10.5%/12, 180, -3000000)= about ₹33,162 a month. - Total paid: ₹33,162 × 180 = about ₹59.7 lakh.
- Interest: about ₹29.7 lakh.
Enter 3000000, 10.5 and 15 in the calculator to check.
Practice 2: A lender offers ₹2 lakh at 14% for 2 years, with a ₹6,000 fee deducted upfront. Write the formulas for the EMI and the APR.
- EMI:
=PMT(14%/12, 24, -200000)= about ₹9,603. - Money received: ₹2,00,000 − ₹6,000 = ₹1,94,000.
- APR:
=RATE(24, -9603, 194000)*12= about 17.1%.
The 3% fee on a short loan adds about 3 points a year. Short loans make fees look much bigger.
Key takeaways
- PMT, FV, PV, NPER and RATE share the same arguments: rate per period, number of periods, payment, present value, future value and type. Give any four to get the fifth.
- Signs: money out is negative, money in positive. Same-sign flows break RATE and NPER.
- RATE turns a loan’s EMIs and the money you really receive into its true cost. That’s the APR the RBI’s KFS rules have required since October 2024.
- NPV treats its first value as one period away: add today’s investment outside.
- XIRR and XNPV use actual dates. XIRR is the right measure for SIPs: a 30% gain over three years of SIPs is about 17.8% a year.
Go deeper
- Microsoft Support: XIRR function.
- Microsoft Support: PMT function.