Skip to content
BLOGS

Excel Financial Functions: PMT, NPV, IRR, XNPV and XIRR

November 2, 2026 · Aditya Gupta

Excel Financial Functions: PMT, NPV, IRR, XNPV and XIRR: cover illustration

The five Excel financial functions most small-business and finance work relies on are PMT (the fixed payment on a loan), NPV and IRR (the value and return of an investment with evenly spaced cash flows), and XNPV and XIRR (the same two measures when cash flows land on irregular dates). Each one has a timing assumption built in, and most wrong answers come from ignoring it.

This guide gives the syntax for each, checked against Microsoft’s documentation, and works through one investment decision from start to finish: a bakery deciding whether to buy a $40,000 oven. You’ll also see the NPV mistake that shows up in a lot of spreadsheets and how much it changes the answer, and why IRR and XIRR can disagree by several percentage points on the same cash flows.

Quick reference: syntax and when to use each

FunctionSyntaxUse it forTiming assumption
PMTPMT(rate, nper, pv, [fv], [type])Fixed loan or lease paymentEqual periods; end of period unless type = 1
NPVNPV(rate, value1, [value2], ...)Present value of future cash flowsEqual periods; first value is one period from now
IRRIRR(values, [guess])Return rate where NPV equals zeroEqual periods; first value is today
XNPVXNPV(rate, values, dates)Present value with actual datesExact dates on a 365-day year; first date is today
XIRRXIRR(values, dates, [guess])Annual return with actual datesExact dates on a 365-day year

One sign rule applies to all five. Excel treats money going out and money coming in with opposite signs: an investment or a loan repayment is negative, cash received is positive. IRR and XIRR need at least one of each, or they can’t find a rate.

PMT: the payment on a loan

PMT returns the fixed payment that pays off a loan over a set number of periods. Microsoft’s PMT documentation warns that rate and nper must use the same units, so for monthly payments, divide the annual rate by 12 and multiply years by 12.

For a $25,000 loan at 8.5% over five years:

=PMT(8.5%/12, 5*12, -25000) returns $512.91.

The minus sign on the loan amount makes the payment come out positive. The optional fv argument handles a balloon payment, and type = 1 moves payments to the start of each period (common for leases). If you need the payment split into interest and principal for every month, our step-by-step guide to building a loan amortization schedule in Excel covers IPMT, PPMT and extra payments.

NPV: how to use it without the common mistake

Net present value is the value today of all future cash flows, discounted at your required rate of return, minus what you invest. A positive NPV means the investment earns more than that rate. For the concept itself, see our guide to net present value.

The bakery’s oven costs $40,000 today. It’s expected to save labor and energy and allow more output, adding these cash flows at the end of each year:

Year012345
Cash flow−$40,000$11,000$12,000$12,500$13,000$10,000

The owner wants at least 9% a year on money tied up in equipment, so 9% is the discount rate.

Here’s the trap. Microsoft’s NPV documentation says the values must be equally spaced and occur at the end of each period, and that the investment begins one period before value1. In other words, NPV assumes the first number you give it arrives one year from now. If your first number is today’s $40,000 purchase, Excel discounts it by a year as well.

With the cash flows in B2:G2 (year 0 in B2):

  • Wrong: =NPV(9%, B2:G2) returns $5,094.53. It treats the oven as bought a year from now.
  • Right: =NPV(9%, C2:G2) + B2 returns $5,553.04. It discounts only the future flows and adds today’s outlay undiscounted, as Microsoft’s own example does.

The difference is $458.51 here, about 8% of the true NPV. On a bigger project or a higher rate, the gap grows. And because the wrong version always shrinks the result by the same factor (it divides the true NPV by 1.09), it can make a good project look marginal, or a slightly negative one look less negative than it really is.

Formula card for correct NPV in Excel: NPV of future cash flows at the rate plus the initial investment. Example: NPV(9%, years 1 to 5) plus negative $40,000 equals $5,553.04; putting the investment inside NPV gives $5,094.53.
Illustrative example: the bakery oven. Keep today's outlay outside the NPV function.

The present value of the five inflows is $45,553.04. Subtract the $40,000 cost and the oven adds $5,553.04 of value at a 9% required return. On these assumptions, it’s worth buying.

IRR: the break-even discount rate

The internal rate of return is the discount rate at which NPV equals zero. Microsoft’s IRR documentation describes it as closely related to NPV, requires at least one positive and one negative value, and says the cash flows must occur at regular intervals, such as monthly or annually.

Unlike NPV, IRR treats the first value as today, so you include the investment in the range:

=IRR(B2:G2) returns 14.22%.

The oven returns about 14.2% a year, comfortably above the 9% hurdle. That matches the NPV result: when IRR is above the discount rate, NPV is positive.

The chart below shows the oven’s NPV at different discount rates. It crosses zero between 12% and 15%, at the 14.22% IRR.

Discount rate0%5%9%12%15%18%
NPV$18,500$10,689$5,553$2,221−$738−$3,376
Line chart of the oven's NPV at discount rates from 0% to 18%: $18,500 at 0%, $10,689 at 5%, $5,553 at 9%, $2,221 at 12%, negative $738 at 15% and negative $3,376 at 18%. NPV crosses zero at the 14.22% IRR.
Illustrative example: NPV falls as the discount rate rises and reaches zero at the IRR of 14.22%.

Where IRR goes wrong

  • More than one sign change. If cash flows go negative, positive, then negative again (say, a major refit in year 3), there can be more than one rate that makes NPV zero, or none. IRR returns one of them without warning.
  • Comparing projects of different sizes. A $5,000 project returning 30% adds less value than a $200,000 project returning 15%. Use NPV to choose between them. Our article on the traps of IRR covers this in more depth.
  • #NUM errors. Excel starts from a guess of 10% and gives up after 20 tries. If you get a #NUM error, try a different guess, such as =IRR(B2:G2, 0.3), and check the signs of your cash flows.

XNPV and XIRR: when cash flows aren’t evenly spaced

Real cash flows rarely land exactly 12 months apart. XNPV and XIRR take a column of dates alongside the values and discount each one by the actual number of days. Microsoft’s documentation for XNPV and XIRR says the first date marks the start of the schedule, later payments are discounted on a 365-day year, and dates should be real dates (entered with DATE or as formula results), not text.

Unlike NPV, XNPV treats the first value as happening on the first date, so you include today’s investment in the range. No adjustment is needed.

Here’s an example where timing matters. A business owner puts spare cash into an investment account in three uneven deposits, then checks its value:

DateCash flowDays from start
Jan 15, 2024−$5,0000
Jul 1, 2024−$3,000168
Mar 10, 2025−$2,000420
Sep 30, 2025$11,800 (account value)624

With values in B2:B5 and dates in A2:A5:

  • =XIRR(B2:B5, A2:A5) returns 13.01% a year.
  • =IRR(B2:B5) returns 7.39%, because it pretends the four flows are exactly one year apart, stretching about 20 months into three years.
  • =XNPV(9%, B2:B5, A2:A5) returns $489.00, positive, while =NPV(9%, B3:B5) + B2 returns −$323.89, negative.

Same money, same rate, opposite conclusions. When you have actual dates, use XNPV and XIRR.

Bar chart comparing returns on the same irregular deposits: IRR, which assumes yearly spacing, gives 7.39%; XIRR, which uses actual dates, gives 13.01%.
Illustrative example: three uneven deposits totaling $10,000 grew to $11,800 in 624 days. Only XIRR reflects the real timing.

Monthly cash flows: converting IRR to an annual rate

NPV and IRR don’t know what a “period” is. Feed them monthly cash flows and they return a monthly result. That catches people out when they compare it with an annual hurdle rate.

Say a cleaning company pays $12,000 for a floor-care machine and earns $1,100 a month extra from it for 12 months. With the cost in B2 and the monthly inflows in B3:B14, =IRR(B2:B14) returns 1.50%. That’s per month, not per year. There are two ways to annualize it:

MethodFormulaResult
Monthly IRR=IRR(B2:B14)1.50% per month
Simple annual (× 12)=IRR(B2:B14)*1217.97%
Effective annual (compounded)=(1+IRR(B2:B14))^12-119.53%

The compounded figure is the one to compare with an annual required return, because it assumes each month’s cash can earn the same rate. It’s also what XIRR would give if the flows had exact dates one month apart (give or take a little, because months aren’t all the same length). The same logic applies to NPV: if your cash flows are monthly, use a monthly discount rate, such as (1+9%)^(1/12)-1, not 9%.

Comparison of NPV and IRR with XNPV and XIRR. NPV and IRR need equally spaced periods, NPV treats the first value as one period out, and they return per-period results. XNPV and XIRR use actual dates on a 365-day year, treat the first date as today and return annual results.
Which pair to use depends on whether your cash flows are evenly spaced. Details from Microsoft Support.

Common mistakes with Excel financial functions

  • Putting the initial investment inside NPV. Keep it outside and add it, or switch to XNPV.
  • Mixing annual rates with monthly cash flows. NPV and IRR return a rate per period. Monthly cash flows give a monthly IRR; don’t compare it with an annual hurdle without converting it. XIRR always returns an annual rate.
  • Dates stored as text. XNPV and XIRR return a #VALUE error if any date isn’t a valid date. Bank exports are a common source of text dates.
  • Wrong signs. All inflows positive and the investment negative. A missing minus sign on PMT’s loan amount gives a negative payment; on IRR, it gives a #NUM error.
  • Blank cells in the range. Microsoft notes that NPV ignores empty cells in a range. A blank year in the middle of your cash flows doesn’t count as a zero; it shifts every later flow one period earlier. Type 0 instead.

What to do next

Build the oven example yourself: six cells of cash flows, then NPV, IRR and XNPV next to each other. Change the discount rate and watch NPV move while IRR stays put. Then add a column of real dates and compare IRR with XIRR. If you just need a quick answer for a single investment, our IRR calculator does the arithmetic for you.

Key takeaways

  • Excel’s NPV function assumes the first value arrives one period from now, so add today’s investment outside the function: =NPV(rate, future flows) + initial investment.
  • IRR is the discount rate that makes NPV zero, and it assumes equally spaced cash flows starting today.
  • XNPV and XIRR use actual dates on a 365-day year, and they can give very different answers from NPV and IRR when timing is uneven.
  • PMT needs the rate and number of periods in the same units, such as an annual rate divided by 12 for monthly payments.
  • Use a consistent sign convention, real dates and zeros instead of blanks, because these cause most wrong results.

Frequently asked questions

Why is Excel's NPV different from my calculator's NPV?

Excel’s NPV function assumes the first cash flow in the range arrives one period from now. Many calculators and textbooks treat the first flow as today. If you put the initial investment inside Excel’s NPV, it gets discounted by a period and the result is too low. Use =NPV(rate, future flows) plus the initial investment, or use XNPV with actual dates.

What is the difference between IRR and XIRR in Excel?

IRR assumes cash flows are equally spaced, such as one per year or one per month, and returns a rate per period. XIRR takes a date for every cash flow, discounts by the actual days between them on a 365-day year, and returns an annual rate. When cash flows are irregular, IRR can be far off; XIRR reflects the real timing.

Why does IRR return a #NUM error?

IRR returns a #NUM error when it can’t find a rate after 20 attempts starting from a 10% guess, or when the cash flows don’t contain at least one negative and one positive value. Check the signs first. Then try a different guess as the second argument, such as 0.3 for a high-return project or 0.01 for a low one.

Should I use NPV or IRR to choose between projects?

Use NPV when you have to choose between projects, because it measures value in dollars at your required return. IRR is a percentage, so it can favor a small project with a high rate over a larger one that adds more value. IRR can also give misleading answers when cash flows change sign more than once. It’s still useful as a quick summary of return.

Does XIRR need the dates in order?

Microsoft says the dates can be in any order, but the first date in the list is treated as the start of the schedule, and a date earlier than it returns a #NUM error. In practice, list the initial investment first and keep later dates after it. Make sure every date is a real date, not text, or XIRR returns a #VALUE error.

Sources

This article is general education, not tax, legal, accounting or investment advice. Rules and thresholds differ by country and change over time, so check the specifics for your situation. See our financial disclaimer.

The Business Skill Forge Newsletter

Get practical finance & accounting tips in your inbox

Join US professionals getting our best guides, templates and tools. Free. Unsubscribe anytime.