Sub topic 3
Using XNPV
This chapter assumes you can build a cash flow list in Excel, enter formulas, and enter real dates. It covers XNPV, XIRR, IRR failure modes, MIRR, and model checks.
Using XNPV
XNPV discounts cash flows that fall on specific dates. Its syntax is XNPV(rate, values, dates). It measures each cash flow's distance from the first date in days, divided by 365.
A2:A6 hold real dates, B2:B6 hold cash flows, D1 holds the rate (10%)
=XNPV(D1, B2:B6, A2:A6)
Manual check on the same 365-day basis:
=SUMPRODUCT(B2:B6 / (1 + D1)^((A2:A6 - A2) / 365))The two results should match. Every date must be later than or equal to the first date, or XNPV returns #NUM!.
Using XIRR
XIRR returns the annualized rate that makes XNPV equal zero. Its syntax is XIRR(values, dates, [guess]). Because it uses the same 365-day basis as XNPV, the two functions agree.
Check the result by substituting it back: =XNPV(XIRR(B2:B6, A2:A6), B2:B6, A2:A6) should return a value near zero.
How Excel solves for IRR and when it fails
Excel finds IRR by trying a starting rate, then adjusting it until the NPV is near zero. The optional guess sets that starting rate. If the solver does not converge within its iteration limit, the function returns #NUM!. A guess such as 0.1 often fixes this.
| Error | Likely cause | Fix |
|---|---|---|
| #VALUE! | A date or value is stored as text | Re-enter the dates as real dates |
| #NUM! | Dates are out of order or no sign change exists | Check that you have both inflows and outflows |
| #NUM! | Solver did not converge | Supply a guess |
When IRR misleads: multiple IRRs and reinvestment
A cash flow stream with more than one sign change can have more than one IRR. Each sign change can produce a separate root. IRR also assumes that interim cash flows are reinvested at the IRR itself, which is often unrealistic for large rates.
NPV versus IRR in project decisions
Use NPV as the primary decision rule. Accept a project when NPV is positive at your cost of capital. When projects compete for the same budget, pick the highest NPV, because IRR can rank a small, high-return project above a larger one that adds more value.
MIRR as an alternative
MIRR separates financing from reinvestment. Its syntax is MIRR(values, finance_rate, reinvest_rate). Negative flows are discounted at the finance rate, and positive flows are compounded at the reinvestment rate. This gives one unique answer.
Cross-checks and troubleshooting errors in your model
Build checks into the model so errors show up early:
- Confirm
NPV(IRR(B3:B7), B4:B7) + B3is near zero. - Confirm XNPV at XIRR is near zero.
- Compare XNPV with the SUMPRODUCT check.
- Compare IRR with MIRR. A large gap suggests reinvestment assumptions matter.
Exercise
Exercise
A project has a -10000 outflow on 2026-01-01 and a +12000 inflow on 2027-01-01. What is the XIRR, and what does a result near zero from XNPV at that rate confirm?
Show answer
XIRR is about 20% (12000/10000 - 1 over 365 days). XNPV at that rate is near zero, which confirms the rate is consistent with the dated cash flows.