In Excel: use =XIRR(B2:B4,A2:A4) with cash flows in B2:B4 and their dates in A2:A4. The sample below returns 12.664072% per year.
On this page9
Syntax
Arguments
| Argument | required / optional | Description |
|---|---|---|
values | required | The cash flows. At least one negative and one positive are required. |
dates | required | A real spreadsheet date for each cash flow. Use equal-length ranges and put the earliest date first. |
guess | optional | Starting estimate. Defaults to 10 %. |
Related functions
Paste the example into A1:B4: dates in column A, cash flows in column B. Keep each date paired with its amount and put the earliest date first.
Use negative amounts for contributions and positive amounts for receipts. For an investment still held, include its remaining value on the measurement date once.
Enter =XIRR(B2:B4,A2:A4) in C2. The values range comes before the dates range.
Format C2 as a percentage: the unchanged sample gives 12.664072%. Check =XNPV(C2,B2:B4,A2:A4) in C3; the result should be approximately zero.
Check XIRR with three dated cash flows
Paste the sample into A1, then put the XIRR formula in C2. DATE formulas create real spreadsheet dates without ambiguous day/month text. These examples use English function names and comma separators; adapt them to your spreadsheet locale.
A1C2 — annualised return
=XIRR(B2:B4,A2:A4)C3 — check that discounted cash flows sum to zero
=XNPV(C2,B2:B4,A2:A4)| Worksheet row | Column A — Date | Column B — Cash flow |
|---|---|---|
| 2 | =DATE(2024,3,1) | -10000 |
| 3 | =DATE(2024,9,12) | -5000 |
| 4 | =DATE(2026,6,30) | 19400 |
If columns are cut off, scroll the table sideways.
| Cell | Formula | Expected result |
|---|---|---|
| C2 | =XIRR(B2:B4,A2:A4) | 12.664072% |
| C3 | =XNPV(C2,B2:B4,A2:A4) | Approximately 0 |
If columns are cut off, scroll the table sideways.
- Format C2 as a percentage with six decimal places. The displayed result rounds to 12.664072%; the cell keeps its full precision for the XNPV check.
- A2 is the earliest date. The following cash flows occur 195 and 851 days later; XIRR discounts them using a 365-day year.
- The first two amounts are money paid in. The final 19,400 is the remaining value at the measurement date; do not also count that same value as a withdrawal.
- For #NUM!, check equal range lengths, at least one negative and one positive flow, and no date before A2. If those checks pass, try a reasonable guess; some cash-flow schedules have no solution or more than one.
- For #VALUE!, check that every date is a real numeric date. Changing the display format alone does not convert date text into a date value.
- Google Sheets also supports XIRR and XNPV with these amounts-and-dates inputs. Function names and argument separators depend on your spreadsheet locale.
Documentation reviewed .
Microsoft: XIRR functionMicrosoft: Choose a cash-flow functionGoogle Sheets: XIRRGoogle Sheets: XNPV
What this does
XIRR calculates the annualised, money-weighted return for cash flows on specified dates. Money paid out is negative; money received, or the remaining investment value at the measurement date, is positive. It finds the rate at which the dated cash flows have a net present value of zero, using actual elapsed days and a 365-day year. IRR instead treats every interval as equal and returns a rate per period. Use XIRR when contributions or withdrawals occur on different dates. A sign change is necessary but does not guarantee a solution; schedules with several sign changes can have multiple valid rates. 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
Enter =DATE(2024,3,1) in A2 and -10000 in B2; =DATE(2024,9,12) in A3 and -5000 in B3; =DATE(2026,6,30) in A4 and 19400 in B4. In C2, =XIRR(B2:B4,A2:A4) returns 12.664072% when formatted as a percentage with six decimal places. The two later cash flows are 195 and 851 days after A2. In C3, =XNPV(C2,B2:B4,A2:A4) should be approximately zero; use the unrounded value stored in C2. The dates matter: the second contribution is invested for less time than the first. Keep those dates and the closing valuation visible so the result can be checked. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.
In Google Sheets
The standard worksheet functions used by this example are listed in Google Sheets. Check the cell references, argument separators and input types in the target spreadsheet, then compare the worked result. This formula-availability check does not establish identical menus, keyboard shortcuts or workbook features, and it is not a product execution test. 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 and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. For “excel xirr function”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.
Common mistakes
- Passing different-sized values and dates ranges, or a date earlier than the first date, causes
#NUM!. - Using only positive or only negative cash flows causes
#NUM!. A schedule with both signs can still have no solution or fail to converge. - Entering dates as unrecognised text can cause
#VALUE!. Use DATE to create real dates; a date display format alone does not convert text. - Counting the same closing value both as a receipt and as a remaining investment value doubles that cash flow.
- Annualising
XIRRagain, or reading it as a monthly return.XIRRalready returns an annual rate, even for a period shorter than a year. - Treating one returned rate as unique when cash flows change sign several times. Different guesses can find different valid roots.
Frequently asked questions
What is the difference between IRR and XIRR?
IRR assumes equally spaced cash flows and returns a rate per period. XIRR uses actual dates and returns an annual rate using a 365-day year. Replacing dated flows with three evenly spaced periods changes the calculation.
Why does XIRR return #NUM!?
Check matching range lengths, at least one positive and one negative amount, and that no date precedes the first one. Excel also returns #NUM! if its iteration does not converge after 100 attempts. A different guess may help, but not every schedule has a solution.
Why does XIRR return #VALUE!?
One or more date entries may not be valid dates. Build dates with DATE and check that the date cells contain numbers, not text that only looks like a date.
Do I need to annualise the result?
No. XIRR already returns an annualised rate. Format its decimal result as a percentage; do not multiply it by twelve or annualise it again.
Does XIRR work in Google Sheets?
Google documents XIRR(cashflow_amounts, cashflow_dates, [rate_guess]) and XNPV for dated cash flows. Use real dates and adapt function names and separators to the spreadsheet locale.