IRR vs XIRR in Excel: Which One Should You Use?
By ExcelReady TeamUpdated 7 min read
The short answer
Use IRR when cash flows are evenly spaced, such as one per year or month; it returns the rate per period. Use XIRR when cash flows fall on irregular dates; it takes a list of dates and always returns a yearly rate. With uneven dates the two can differ a lot, and XIRR is the accurate one.
Key takeaways
- IRR(values) assumes every cash flow is exactly one period apart. XIRR(values, dates) uses the real dates.
- IRR returns a rate per period (monthly flows give a monthly rate); XIRR always returns an annual rate.
- Both need at least one negative and one positive cash flow, or they return #NUM!.
- If cash flows are not evenly spaced, IRR gives the wrong answer without any warning.
- XIRR is the rate at which XNPV is zero; IRR is the rate at which NPV is zero.
On this page+
IRR vs XIRR comes down to dates. IRR assumes your cash flows arrive at equal intervals, like once a year, and returns the rate per interval. XIRR reads the actual date of each cash flow and returns a yearly rate. If your payments come on irregular dates, use XIRR; if they are evenly spaced, both work. This guide is for analysts, finance students and job seekers who need to pick the right function and explain the result.
This article explains how the functions calculate. It is not advice on any investment.
IRR vs XIRR at a glance#
Both functions find an internal rate of return: the discount rate at which the cash flows are worth exactly zero today. They differ in how they measure time.
| Feature | IRR | XIRR |
|---|---|---|
| Syntax | =IRR(values, [guess]) | =XIRR(values, dates, [guess]) |
| Timing of cash flows | Equal periods, one after another | The real date of each cash flow |
| Result | Rate per period (yearly, monthly...) | Always an annual rate |
| Days in a year | Not used | 365 (each flow is discounted by days/365) |
| Order of cash flows | Must be in time order | First date must be the earliest; others can be in any order |
| Matching NPV function | NPV | XNPV |
| Errors | #NUM! with no sign change or no answer after 20 tries | #NUM! with no sign change, bad dates, or no answer after 100 tries |
| Availability | All Excel versions | All current Excel versions |
The optional guess is a starting point for Excel's search. It defaults to 10%, and you rarely need it.
How IRR works#
IRR treats the list of values as a timeline with equal steps. The first value is at period 0, the next at period 1, and so on. It then finds the rate where the discounted values add up to zero.
Take a project that costs 10,000 today and returns 3,000, 4,000 and 5,000 at the end of each of the next three years. With the values in B2:B5:
=IRR(B2:B5)The result is 8.90% per year. You can check it by hand: 3,000 / 1.089 + 4,000 / 1.089² + 5,000 / 1.089³ is very close to 10,000, so the total with the -10,000 is about zero.
If the cash flows are monthly, IRR returns a monthly rate. For -1,000 followed by twelve monthly payments of 90, IRR gives 1.20% a month. To turn that into a yearly figure, use =(1+B15)^12-1 (where B15 holds the IRR), which gives 15.45%. Multiplying by 12 gives 14.45%, a nominal rate that ignores compounding. The percent change lesson is a good refresher on working with rates like these.
How XIRR works#
XIRR adds a second list: the date of each cash flow. Each value is discounted by the number of days since the first date, divided by 365. The result is always an annual rate.
=XIRR(B2:B5, A2:A5)Dates in Excel are numbers (days since 1 January 1900), which is why XIRR can subtract them. If that is new, the date basics lesson shows how Excel stores dates.
The formula XIRR solves is:
Sum of value / (1 + rate) ^ ((date - first_date) / 365) = 0The left side is called XNPV, the dated version of net present value. XIRR is the rate that makes XNPV zero, in the same way that IRR is the rate that makes NPV zero. The guide to the NPV function and the comparison of NPV vs PV explain discounting in more detail.
Side-by-side example: the same cash flows, two answers#
The difference shows up as soon as the dates are uneven. Here is one investment in A1:B5:
| A | B | |
|---|---|---|
| 1 | Date | Cash flow |
| 2 | 1 Jan 2024 | -10,000 |
| 3 | 15 Jun 2024 | 2,000 |
| 4 | 1 Mar 2025 | 3,000 |
| 5 | 15 Jan 2026 | 7,000 |
The money comes back over about two years: 166, 425 and 745 days after the start.
| Formula | Result | What it assumes |
|---|---|---|
=IRR(B2:B5) | 7.91% | The flows are exactly 1, 2 and 3 years apart |
=XIRR(B2:B5,A2:A5) | 12.61% | The flows arrive on the real dates |
IRR spreads the payments over three years, so it thinks you waited longer for your money and reports a lower return. XIRR sees that everything came back within about two years. The gap is almost five percentage points, and IRR gives no warning.
You can confirm the XIRR answer with the dated discounting formula. At 8%, which is below the XIRR, the discounted cash flows add up to 656.49:
=SUMPRODUCT(B2:B5/(1+E1)^((A2:A5-A2)/365))with 8% in E1. A positive result means the true rate is higher than 8%. Put 12.61% in E1 and the result is very close to 0. That is exactly what XIRR finds for you.
Now compare the evenly spaced project from earlier. With dates of 1 January 2024, 2025, 2026 and 2027, XIRR returns 8.88% against IRR's 8.90%. The tiny gap is because 2024 is a leap year with 366 days, while XIRR always divides by 365. For truly even flows, the two agree closely.
When to use IRR#
IRR is the simpler choice when the timing is regular:
- Yearly project models where each column is one year and cash flows are assumed at year end.
- Monthly schedules, such as a loan or lease, as long as you convert the monthly rate to an annual one.
- Teaching and interviews, where the question says "assume annual cash flows".
- Quick checks when you don't have dates, only a sequence of amounts.
A special case: with just a start value and an end value, IRR equals the compound annual growth rate. The CAGR formula guide shows that calculation with POWER.
When to use XIRR#
XIRR is the right choice whenever real dates matter:
- Investments with irregular deposits and withdrawals, such as adding money at different times of year.
- Private deals and projects where payments land on specific dates.
- Actual results, as opposed to a plan: real invoices and receipts rarely fall exactly 12 months apart.
- Comparing returns over different time spans, because XIRR always gives a yearly rate.
The same idea applies to other dated functions: XNPV is the dated version of NPV. For growth without a series of cash flows, the FV function works forward from a known rate instead.
Common IRR and XIRR mistakes#
Most wrong answers come from the inputs, not the functions:
- Using IRR on irregular dates. As the example shows, the result can be far off. Use XIRR.
- No sign change. The first cash flow (money out) must be negative and at least one later flow positive. All positive or all negative gives #NUM!. The guide to the #NUM! error lists other causes.
- Reading a monthly IRR as yearly. 1.20% a month is not 1.20% a year. Convert it with
(1+rate)^12-1. - Dates stored as text. XIRR needs real dates. If dates are left-aligned, convert them with DATEVALUE first, or XIRR returns #VALUE!.
- First date not the earliest. XIRR returns #NUM! if any date comes before the first one.
- Missing zero periods in IRR. If a year has no cash flow, type 0 in that cell. Leaving it out shifts every later flow one period earlier.
Our recommendation#
Default to XIRR whenever you know the dates of your cash flows. It handles uneven timing, always returns an annual rate and matches how money really moves. Use IRR for clean models with equal periods, such as a five-year plan with one column per year, or when a test question asks for it by name. If the two give very different answers on your data, trust XIRR and check the dates.
Whichever you use, sense-check the result with a discounting formula like the exercise on this page. A rate is only as reliable as the cash flows and dates behind it.
Practise it#
IRR and XIRR depend on two everyday skills: working with dates as numbers, and reading rates of change. Practise date basics in a live spreadsheet to see how Excel subtracts dates, then practise percent change so rates and growth feel natural. Then try the XNPV exercise on this page and change the rate in E1 until the result reaches zero.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
XIRR is the rate that makes XNPV zero. Check the maths by hand: in E2, discount every cash flow at the rate in E1 with =SUMPRODUCT(B2:B5/(1+E1)^((A2:A5-A2)/365)).
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Cash flow | |||||
| 2 | XNPV | |||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 | ||||||
| 8 |
Tip: (A2:A5-A2)/365 turns each date into years since the start. Each cash flow is divided by (1+rate) to that power, and SUMPRODUCT adds the results.
Practise this in a lesson
Frequently asked questions
What is the difference between IRR and XIRR?
IRR assumes cash flows arrive at equal intervals and returns a rate per interval. XIRR takes the actual date of each cash flow and returns an annual rate. XIRR is the right choice when the dates are irregular.
Why are my IRR and XIRR results different?
Usually because the cash flows are not exactly one year apart. IRR treats each value as one period after the last, while XIRR measures the real number of days. Even yearly flows differ slightly, because XIRR counts 365-day years and leap years have 366 days.
Is XIRR annual or monthly?
XIRR always returns an annual rate, whatever the spacing of the dates. IRR returns a rate per period, so monthly cash flows give a monthly IRR that you must convert to a yearly figure.
Why does IRR or XIRR return #NUM!?
The cash flows need at least one negative and one positive value. #NUM! also appears when Excel can't find a rate within its number of tries, or, for XIRR, when a date comes before the first date or the values and dates are different lengths.
How do I convert a monthly IRR to an annual rate?
Use =(1+monthly_IRR)^12-1 for the effective annual rate. Multiplying by 12 gives the nominal annual rate, which is a little lower.