Use XIRR and XNPV whenever cash flows do not fall exactly one year (or one period) apart, which is almost always the case in real projects. IRR and NPV assume evenly spaced cash flows and can give a very different answer. On the worked example below, IRR says 9.92% while the correct dated return from XIRR is 15.04%.
What NPV, IRR, XNPV and XIRR actually measure
- NPV (net present value): the value today of all future cash flows, discounted at your required rate, minus the investment. Positive means the project earns more than the required rate.
- IRR (internal rate of return): the discount rate at which NPV is zero. It is the project's own rate of return.
- XNPV and XIRR: the same two measures, but each cash flow is discounted for its actual number of days from the first date, divided by 365.
The Excel functions differ in one crucial way. NPV and IRR only see a list of values and assume each is one period after the last. XNPV and XIRR take a second range of dates and use the real gaps between them.
XIRR vs IRR in Excel with example
An illustrative company is evaluating a capacity expansion. It invests ₹5 crore on 1 April 2026 and expects the following inflows, which follow the project's commissioning and customer billing pattern rather than neat year-ends. Its required return is 12%.
| Row | A: Date | B: Cash flow (₹) |
|---|---|---|
| 2 | 01-Apr-2026 | (5,00,00,000) |
| 3 | 15-Dec-2026 | 80,00,000 |
| 4 | 30-Jun-2027 | 1,20,00,000 |
| 5 | 31-Mar-2028 | 1,50,00,000 |
| 6 | 30-Nov-2028 | 1,50,00,000 |
| 7 | 30-Sep-2029 | 1,80,00,000 |
Total inflows are ₹6.80 crore against ₹5 crore invested, spread over about three and a half years. The formulas and what Excel returns:
| Formula | What it does | Result |
|---|---|---|
| =XNPV(12%,B2:B7,A2:A7) | Dated NPV at 12% | ₹29,50,898 |
| =XIRR(B2:B7,A2:A7) | Dated annual return | 15.04% |
| =IRR(B2:B7) | Assumes one year between each flow | 9.92% |
| =B2+NPV(12%,B3:B7) | Periodic NPV, correct structure | (₹28,67,658) |
| =NPV(12%,B2:B7) | Wrong: discounts the investment too | (₹25,60,409) |
The dated measures say the project clears the 12% hurdle comfortably. The periodic measures say it fails. The difference is not a rounding issue: IRR treats the six cash flows as five full years apart, stretching a three-and-a-half-year project to five years and pushing every inflow further into the future.
How XNPV works: the step table
Excel's XNPV discounts each cash flow by (1 + rate) raised to (days from the first date ÷ 365). You can reproduce it by hand to check the model:
| Date | Days | Years | Discount factor at 12% | Present value (₹) |
|---|---|---|---|---|
| 01-Apr-2026 | 0 | 0.0000 | 1.0000 | (5,00,00,000) |
| 15-Dec-2026 | 258 | 0.7068 | 0.9230 | 73,84,146 |
| 30-Jun-2027 | 455 | 1.2466 | 0.8683 | 1,04,19,030 |
| 31-Mar-2028 | 730 | 2.0000 | 0.7972 | 1,19,57,908 |
| 30-Nov-2028 | 974 | 2.6685 | 0.7390 | 1,10,85,449 |
| 30-Sep-2029 | 1,278 | 3.5014 | 0.6725 | 1,21,04,365 |
| XNPV | 29,50,898 |
The present values of the inflows add up to ₹5,29,50,898; less the ₹5 crore investment gives ₹29,50,898. Note that Excel always divides by 365, even across a leap year, which is why 31 March 2028 comes out at exactly 2.0000 years despite 29 February 2028 falling in between. A one-line check that reproduces XNPV:
=SUMPRODUCT(B2:B7/(1+12%)^((A2:A7-A2)/365))
XIRR is simply the rate at which this same sum equals zero. At 15.04% the present values of the inflows add back to ₹5 crore.
Common errors with NPV and IRR in Excel
1. The NPV function treats the first cash flow as period 1
This is the most frequent error in project models. =NPV(rate, range) assumes the first value arrives at the end of the first period. If your range starts with the time-zero investment, Excel discounts it by one period, as if you were paying it a year later. The result above, (₹25,60,409), is exactly the correct periodic figure of (₹28,67,658) divided by 1.12. The fix is to keep the initial outflow outside the function: =B2+NPV(12%,B3:B7).
2. Mixing dated and periodic functions
A model that calculates XNPV but reports IRR (or NPV with XIRR) will give answers that contradict each other: a positive NPV with an IRR below the hurdle rate, as in this example. Pick one family for the whole model. If any cash flow is off a regular schedule, use XNPV and XIRR throughout.
3. Forgetting that IRR returns a rate per period
Run IRR on monthly cash flows and you get a monthly rate. A monthly IRR of 1% is not 12% a year; it is (1.01)^12 - 1 = 12.68%. XIRR avoids this because it is always annualised.
4. Date and sign problems
- Dates stored as text return #VALUE!. Check with =ISNUMBER(A3).
- XIRR needs at least one negative and one positive value, or it returns #NUM!.
- If XIRR returns #NUM! on unusual cash flows, give it a starting guess as the third argument, for example =XIRR(B2:B7,A2:A7,10%).
- The first date in the range is treated as the start date. Put the investment date first.
5. Relying on IRR alone
Cash flows that change sign more than once (an investment, inflows, then a large decommissioning or retention outflow) can have more than one IRR. IRR also ranks projects of different sizes badly. When choosing between projects, use NPV as the deciding measure and IRR as a supporting one.
6. Ignoring the reinvestment assumption
IRR and XIRR implicitly assume that every inflow can be reinvested at the project's own rate of return. For a project with a high IRR and large early inflows, that flatters the result, because the business is unlikely to find other uses for that cash at the same rate. NPV and XNPV assume reinvestment at the discount rate, which is more realistic. Excel's MIRR function lets you set a separate finance rate and reinvestment rate, but like IRR it assumes evenly spaced periods, so use it only on a regular schedule.
Which Excel function should you use?
| Situation | Use |
|---|---|
| Cash flows exactly one year (or one month) apart, investment at time zero | =B2+NPV(rate,B3:Bn) and IRR |
| Any irregular dates: project milestones, mid-year starts, billing cycles | XNPV and XIRR |
| Returns on an investment with irregular top-ups or withdrawals | XIRR |
| Comparing two projects of different size | XNPV first, XIRR as support |
| Cash flows that change sign more than once | XNPV; treat any IRR with caution |
In practice, set up every appraisal sheet with a date column from the start, even if the first draft uses year-end dates. Adding real dates later is then a matter of overwriting one column, and the formulas do not change.
How to choose the discount rate
The discount rate is the return the providers of capital require for a project of this risk. In practice:
- Start with WACC: the weighted average of the post-tax cost of debt (your borrowing rate less the tax saving on interest) and the cost of equity.
- Adjust for project risk: a new product or a new geography deserves a higher rate than a like-for-like capacity addition.
- Match rate and cash flows: post-tax cash flows with a post-tax rate; nominal cash flows (with inflation) with a nominal rate.
- Run a sensitivity: show XNPV at the base rate and 2 percentage points either side. If the decision flips within that range, say so in the paper.
A project that fails at the hurdle rate only because of a slow start may still be worth discussing, but that should be an explicit judgement in the board note, not a side effect of using the wrong Excel function.
For loan-funded projects, the financing cash flows (drawdowns, interest and repayments) can be laid out with the EMI calculator before you build the equity cash flows. The theory behind WACC and capital budgeting is covered in the corporate finance course.
Frequently asked questions
What is the difference between IRR and XIRR in Excel?
IRR assumes every cash flow is exactly one period apart, so it only uses the order of the values. XIRR uses the actual date of each cash flow and returns an annual rate. When cash flows are irregular, IRR can be badly wrong and XIRR is the right function.
Why does the Excel NPV function give a different answer from my calculation?
Excel's NPV function treats the first value in the range as arriving at the end of period 1, so it discounts the initial investment too. Put the time-zero cash flow outside the function: =B2+NPV(rate,B3:B7). For dated cash flows use XNPV instead.
Does XIRR give an annual or a monthly rate?
XIRR always returns an annualised effective rate, because it measures time in days divided by 365. IRR returns a rate per period of your data, so IRR on monthly cash flows gives a monthly rate that must be converted with (1 + r)^12 - 1.
What discount rate should I use for NPV?
Use the return investors and lenders require for a project of that risk, usually the company's weighted average cost of capital, adjusted up for riskier projects. Keep it consistent with the cash flows: post-tax cash flows with a post-tax rate, nominal cash flows with a nominal rate.
This article is general information, not professional advice. Rules and due dates change; confirm with your AD bank, CA or the official portal before acting. Last reviewed 15 November 2026.