Converter tool

XIRR Calculator

Work out XIRR for cash flows on any dates, the way Excel does, plus XNPV, IRR, NPV, totals and a payback date. Paste them, type them or read them from a CSV or Excel file.

Money you pay in is negative and money you get back is positive. Tabs, commas, semicolons or spaces between the columns all work.

Number formatTick when commas mark decimals and dots group thousands.

Pasted text, typed rows and chosen files are read by this browser tab, and the results and downloads are built there too. Up to 20,000 cash flows.

Add cash flows to see results

Preview

Output Preview

Paste dates and amounts, or load Excel's example, to see XIRR, XNPV, IRR and NPV.

XIRR Calculator (IRR and NPV)

Operator: Abdulla Al Fahad. How tools are built and checked

XIRR is the yearly return on money that goes in and comes out on irregular dates: monthly investments into a fund, a rental property with uneven repairs and rent, a private loan repaid early, a startup stake bought in two rounds and sold years later. It is the rate at which all those flows, discounted by the actual number of days between them, add up to zero. Excel's XIRR function is the usual way to get it, and this calculator works the same way without needing a spreadsheet open.

Paste two columns, type the flows into a grid, or open a CSV, TXT, XLSX or XLS file and pick the date and amount columns. Alongside XIRR you get XNPV at a rate you choose, IRR and NPV for the same flows treated as evenly spaced, money in and out, the multiple of money returned, and the payback date. When the flows change sign more than once and several rates fit, every rate found is listed instead of one being picked silently.

Key features

  • XIRR computed as Excel defines it: actual days divided by 365, measured from the earliest date, in any row order
  • Newton's method from 10%, Excel's default guess, backed by a scan of every rate from -99.99% upwards when Newton fails
  • A warning and the full list of rates whenever the flows change sign more than once
  • XNPV at your discount rate, valued on the earliest date
  • IRR and NPV treating each row as one period, with the typical gap between dates named and a warning when the gaps are uneven
  • Excel's NPV and the first-flow-at-time-0 NPV side by side, with the one-line reason they differ
  • Money in, money out, net, multiple and the payback date
  • A list of every row that could not be read, with its row number and the reason
  • Day-first or month-first dates worked out from the data, with the choice shown and changeable
  • XLSX with live XIRR, XNPV, IRR and NPV formulas, and a CSV of the results

Reading dated flows and writing the formula sheet

Each flow is a date and an amount. Money you pay in is negative and money you get back is positive. Pasted text can separate the two columns with tabs (what a copy from Excel or Google Sheets gives), commas, semicolons, pipes or spaces; the calculator tries each one on the first 200 lines and keeps the split that turns the most lines into a date and an amount. A header row is spotted when the first row holds text that is neither a date nor a number, and the date and amount columns are guessed from the header names, then from what the rows contain. Both guesses can be changed.

Dates can be ISO (2024-03-15 or 2024/03/15), numbers with the day first or the month first (15/03/2024, 03/15/2024, 15.03.24), month names (15 Mar 2024, 15-Mar-24, Mar 15, 2024, 15th March 2024, with or without a weekday in front), eight-digit 20240315, or Excel serial numbers such as 45366. A time after the date is ignored. Two-digit years follow Excel: 00 to 29 are 2000 to 2029 and 30 to 99 are 1930 to 1999. In XLSX and XLS files, cells formatted as dates are read from the serial number Excel stores, so their display format never causes confusion, and workbooks saved in Excel's 1904 date system, the old Mac default, are converted so their dates come out right.

Amounts can carry currency signs or codes ($1,250.50, USD 1,250, Rs. 5,000), thousands separators written as commas, spaces, apostrophes or in lakh grouping (1,00,000), and negatives written as -1,250.50, (1,250.50) or 1,250.50-. Tick Decimal comma for figures such as 1.234,56. In comma-separated text, an amount such as 10,000.00 that the commas broke apart is joined again in rows that have more fields than the rest; when every row has the same number of fields, nothing is joined, and a warning says so if the rows look like split amounts. Files can be up to 10 MB and the calculation takes up to 20,000 flows; the typing grid holds 500 rows.

The XLSX holds the flows sorted by date with their source row numbers, then the results beside them as formulas: =XIRR, =XNPV against a rate cell, =IRR, =NPV in Excel's form and with the first flow at time 0, and SUMIF totals. Each formula stores the value shown on the page, and the payback date is written as a value. The results CSV has three columns, Metric, Value and Notes, with plain decimals and ISO dates.

How it works

XIRR is the rate r that solves the sum of a_k / (1 + r)^((d_k - d_0) / 365) = 0, where a_k are the amounts, d_k their dates and d_0 the earliest date. Starting from the earliest date rather than the first row does not move the answer: shifting the starting date multiplies every term by the same positive number, so the rate that makes the sum zero stays the same. Flows on the same date are added together first, since they share a discount factor.

The rate is found with Newton's method starting at 10%, the guess Excel uses by default, with the arithmetic scaled so that rates near -100% over decades cannot overflow. If Newton fails to settle, or if the flows change sign more than once, the calculator also steps through every rate from -99.99% to about 2.7 x 10^45 % and narrows each sign change down by bisection. With one sign change in date order there is exactly one answer. With several, there can be more than one, and all of them are shown; the one closest to 10% is reported as the XIRR.

If every amount has the same sign, no rate can bring the total to zero, and no number is shown, only a message explaining why. XNPV uses the same formula at the rate you type. IRR and NPV ignore the dates and treat the rows, in date order, as one period apart: Excel's NPV discounts the first value by a full period, and the textbook version leaves the first value undiscounted, which multiplies the result by (1 + rate). The typical gap between dates is shown so you know what one period stands for.

Payback is found by adding the flows in date order, same-date flows together, and taking the first date the running total is back at zero or above. When the first flow is money in, there is nothing to pay back, so payback is reported as not applicable.

When to use it

  • Working out the return on monthly fund investments (a SIP) with the current value added as a final positive flow
  • Measuring a rental property's return from the purchase, repair bills, rent and the sale price on their real dates
  • Checking the return a private lender or peer-to-peer platform reports against the actual repayments
  • Comparing two investment offers whose cash flows arrive on different schedules
  • Testing a project whose flows go negative again at the end, such as a mine with closing costs, for more than one IRR

Inputs

  1. Choose Paste, Upload a file or Type rows. Load Excel's example if you want to see the calculator work on known numbers first.
  2. For a file or pasted table, check that the header box and the date and amount columns are right.
  3. Look at the date order note. If your dates are written day first and the calculator could not tell, pick Day first.
  4. Tick Decimal comma if your amounts look like 1.234,56.
  5. Type the discount rate for XNPV and the rate per period for NPV.
  6. Read the XIRR, check the list of unreadable rows, then download the XLSX or the results CSV.

Worked example

Excel's documented XIRR example, pasted with a header row

Date        Amount
1/1/2008    -10,000
3/1/2008      2,750
10/30/2008    4,250
2/15/2009     3,250
4/1/2009      2,750

Results

Date order        month first, because 10/30/2008 only works that way
XIRR              37.34% a year (37.3363%, or 0.373363 as a decimal)
XNPV at 9%        2,086.65, valued on 1 Jan 2008
Money in / out    13,000.00 / 10,000.00, net 3,000.00
Multiple          1.30x
Payback date      15 Feb 2009
IRR per period    11.54%, with gaps from 45 to 243 days, so prefer XIRR

Tips for best results

  • To get the return on a holding you still own, add its current value as a positive amount dated today. Without it, XIRR only sees the money paid in.
  • Flipping every sign gives the same XIRR, so a lender's view and a borrower's view of a loan have the same rate. The multiple and the payback date, though, assume negative amounts are what was invested.
  • When the flows change sign more than once, compare XNPV at your cost of capital instead of relying on a single XIRR.
  • Use Edit these rows by hand after pasting to fix a stray row: the grid takes the parsed flows with dates rewritten as YYYY-MM-DD, which read the same whichever date order is chosen, and amounts written in the number format you have selected.
  • If Excel shows #NUM! for XIRR but this page finds a rate, Excel's Newton search probably wandered off from its 10% start. The XLSX from this page passes a guess to XIRR when one is needed so that Excel lands on the same rate.

Limits

Only actual days divided by 365 is used, like Excel. Day counts such as 30/360 or actual/actual used for some bonds are not offered.

Fees, taxes and dividends count only if they are in the list as flows. The calculator cannot see anything you leave out.

There is no guess input. When more than one answer is possible, every rate between -99.99% and the top of the scan is searched instead, and two answers closer together than the scan step can be missed. The step is about 0.2% for everyday rates and widens in proportion when the flows fall on more than 2,000 different dates, to about 2% at 20,000.

Losing almost everything in a few days, or multiplying the money in a few days, can put the answer outside the searched range, and the page then reports that no rate was found.

Dates before 1900 are not read, amounts are not converted between currencies, and MIRR is not calculated.

Common errors and how to fix them

"Every amount has the same sign, so no rate can make them add up to zero."
XIRR needs at least one negative and one positive amount. Check that investments are negative and returns positive, and that the current value of anything you still hold is included.
A row is listed as "not a valid date when read month first".
The date only works the other way round, such as 25/03/2024. Choose Day first under Date order. If some dates only work one way and others the other way, the column mixes formats and the listed rows need fixing at the source.
An amount such as 1234,56 is listed as looking like it uses a decimal comma.
Tick Decimal comma. If the columns are also separated by commas, change the separator to a tab or semicolon first, because a comma cannot mark both.
"This calculator reads up to 20,000 cash flows."
Add the flows up by month or by week in the spreadsheet first. Summing flows within a month moves them by days at most and barely changes the XIRR.

Best practices

  • Keep a column of real dates in your own records rather than month labels, so each flow keeps its exact day.
  • Check the payback date and the multiple next to the XIRR. A high rate on a tiny amount for a few weeks can look impressive and mean little.
  • Keep the XLSX with the decision it supported: the formulas show exactly which flows produced the rate.
  • Re-run the calculation when new flows arrive instead of averaging old results.

Why XIRR and IRR give different answers

IRR assumes every row is exactly one period apart. Flows of -1,000, 100, 100 and 1,100 on 1 January of 2020, 2021, 2022 and 2023 have an IRR of exactly 10.0000%. Their XIRR is 9.9895%, because 2020 had 366 days, which XIRR counts as 1.0027 years, so the same growth is spread over slightly more time.

The gap grows with monthly flows, because months run from 28 to 31 days. Investing 5,000 on the 5th of every month through 2024 and holding 64,000 on 5 January 2025 gives an XIRR of 12.47%. The IRR per month is 0.9889%, which compounds to 12.53% a year. For flows on uneven dates, such as Excel's example where the gaps run from 45 to 243 days, IRR is simply the wrong tool: it reports 11.54% where the real yearly rate is 37.34%.

When more than one rate fits

A flow pattern of -100, then +230 a year later, then -132 a year after that changes sign twice, and both 10% and 20% make it add up to zero. Neither is the return in any useful sense. XNPV tells the real story: at 5% the flows are worth -0.68, at 15% they are worth +0.19, and at 25% they are worth -0.48, so the project only pays at costs of capital between the two rates.

Whenever the amounts change sign more than once in date order, the page lists every rate it finds and says which one it reports. In the XLSX, the XIRR formula then carries that rate as its guess, because Excel's answer otherwise depends on where its search starts.

Excel's NPV and the textbook NPV

Excel's NPV assumes the first value arrives one period from now and discounts it. Most finance courses put the first flow, usually the investment, at time 0. For -10,000, 3,000, 4,200 and 6,800 at 10%, Excel's NPV is 1,188.44 and the time-0 version is 1,307.29, which is 1,188.44 x 1.10. Both are shown, so you can use whichever matches the convention you are working to.

How day-first and month-first are decided

A date such as 15/03/2024 can only be day first, and 03/15/2024 only month first, so one such value settles the whole column. If every date's first number is 12 or less, the calculator looks for a pattern across at least three dates: when the first number is the same on every row and the second changes, as with payments on the 5th of each month, the dates are read day first, and the mirror case is read month first. If nothing decides it, dates are read month first. Both of these guesses are shown as a warning with a date-order selector beside it, because a month of US dates such as 01/02/2024, 01/05/2024 and 01/09/2024 fits the same pattern as payments on the 1st of each month. Your own choice under Date order always wins.

Where your data goes

Investment flows reveal account balances and timing that most people would rather keep to themselves. Pasted text, typed rows and chosen files are read inside this browser tab, spreadsheets are opened there with SheetJS, and the XLSX and CSV are built there too. Nothing you enter is sent anywhere by the calculator.

Frequently asked questions

Is XIRR the same as the return my fund reports?

Usually not. XIRR is a money-weighted return: it rewards or punishes the timing of your own deposits and withdrawals. It is not the time-weighted return that fund managers report, and the two can differ a lot.

Why does the results CSV give 0.3733625335 for Excel's example when Excel's documentation says 0.373362535?

Solved to full precision, the rate for that example is 0.37336253352, and Excel's documentation prints 0.373362535. The two agree to eight decimal places; both round to the 0.373363 and 37.34% shown on the page.

Do the rows need to be in date order?

No. The rate is the same in any order. The flow table and the XLSX list the flows sorted by date, because Excel's XIRR and XNPV expect the first date to be the earliest.

Which sign should investments have?

Negative for money you put in and positive for money you get back is the usual convention, and the multiple and payback date assume it. The XIRR itself comes out the same if every sign is flipped.

What does a payback date of Not reached mean?

The running total of the flows never gets back to zero, so the money paid in has not yet been returned in cash. Adding the current value of the holding as a final flow usually changes that.

Can I use it for SIP or mutual fund returns?

Yes. List each instalment as a negative amount on its date and add the current value as a positive amount dated today. Monthly instalments written as 05/01/2024, 05/02/2024 and so on are recognised as day first because the day number repeats.