In Excel: use =XIRR(values, dates) — it returns the annualised return of cash flows that happened on real dates rather than at even intervals.
On this page8
Syntax
Arguments
| Argument | required / optional | Description |
|---|---|---|
values | required | The cash flows. At least one negative and one positive are required. |
dates | required | The date of each cash flow. |
guess | optional | Starting estimate. Defaults to 10 %. |
Related functions
3 one value per year
Need it as an auditable file?
Ships inside the linked template — formula-driven, unlocked, audit-ready.
Need it as an auditable file?
Ships inside the linked template — formula-driven, unlocked, audit-ready.
What this does
XIRR is the return measure that matches how investments actually behave: contributions and withdrawals on arbitrary dates, and a result already annualised. That makes it the right function for a personal portfolio, a property with irregular costs, or a fund with capital calls — cases where IRR's assumption of even periods produces a meaningfully wrong number. It solves iteratively, so a difficult series may need the guess argument. At least one negative and one positive value are required, or it returns #NUM!. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. Treat “excel xirr function” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected formula shows up while it is still harmless. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That turns a calculation you can defend to a CFO or an auditor into a method you can reuse, explain, and defend when the workbook leaves your screen.
A worked example
Investing -10,000 on 1 Mar 2024, adding -5,000 on 12 Sep 2024, and holding 19,400 on 30 Jun 2026: =XIRR(B2:B4, A2:A4) returns roughly 17 % annualised, correctly weighting the second contribution for the shorter time it was invested. IRR over the same three numbers would treat them as three even periods and mislead. XIRR is the honest return figure for anything with irregular contributions, which is most real-world investing. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.
In Google Sheets
Everything above works in Google Sheets too. Excel and Sheets share the formula syntax used here; only the surrounding menus are arranged differently. That portability is deliberate — learn it once and it follows you between the two tools and across Windows and Mac. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. Treat “excel xirr function” as a small building block rather than a chore. Once the inputs sit in their own cells and the formula reads from them, the same setup answers a dozen related questions with a tweak, and Excel keeps every dependent figure current as the data changes. The tool above is there so you can rehearse and verify before committing anything to a real workbook; the steps and worked example are there so the logic sticks. Get it right once and it stops costing you time — it starts saving it, every time the question comes back around.
Common mistakes
- Omitting the current value as a closing cash flow, which makes the return look far worse than it is.
- All values sharing a sign, which returns
#NUM!— there must be at least one of each. - Annualising the result again;
XIRRalready returns an annual rate.
Frequently asked questions
What is the difference between IRR and XIRR?
IRR assumes evenly spaced periods; XIRR uses actual dates and returns an annualised figure. For real portfolios, XIRR is nearly always correct.
Why does XIRR return #NUM!?
Either every value has the same sign, or the iteration did not converge. Supply a guess near the expected return.
Do I need to annualise the result?
No — XIRR is already annualised, whatever the span of the dates.