How to calculate XIRR for dated investments and withdrawals
XIRR measures an annualised, money-weighted return when cash moves on different dates. It answers what annual discount rate makes the value of all contributions and receipts balance out. The size of each transfer and the number of days it spends invested both affect the result.
How the calculation works
Enter contributions as negative amounts and withdrawals or final value as positive amounts. XIRR finds the annual discount rate that sets the net present value of the dated cash flows to zero. Some cash flow patterns have multiple solutions or no solution.
Worked example
A cash flow of −₹10,000 followed 730 days later by +₹12,100 has an XIRR of 10%.
Build a cash-flow history from the investor's perspective
Add one row for each date on which money moved into or out of the investment you are measuring. Use a negative number for money you paid in and a positive number for money you received. For example, a ₹5,000 contribution goes in as −5000 and a ₹2,000 redemption paid to you goes in as 2000. Enter the actual dates from your statements.
For an open position, add an ordinary positive cash-flow row for the value remaining on the date you choose to measure performance. This value represents what you still hold at the end of the calculation. A portfolio with ₹45,000 still invested and ₹5,000 already withdrawn has one row for each completed redemption and a separate final ₹45,000 valuation row.
Define the investment boundary before entering transfers. For a portfolio that includes several funds, a transfer between two funds inside the portfolio may leave its overall cash unchanged. For a calculation on one fund, a transfer out of that fund is a withdrawal from the position being measured. Use the same perspective for all inputs.
See how actual days affect the calculation
The calculation discounts each cash flow relative to the earliest date. It divides the number of calendar days between the dates by 365, including when the calendar interval crosses a leap day. If d is the elapsed number of days and r is the annual rate as a decimal, the discounted value of a cash flow C is C ÷ (1 + r)^(d ÷ 365).
Add all the discounted cash flows to get the net present value at that rate. The calculator looks for the rate where that sum is zero. With only two transactions exactly 730 days apart, a contribution of ₹10,000 and a receipt of ₹12,100 give 10%. At 10%, discounting ₹12,100 back by two years gives ₹10,000, which offsets the original negative amount.
An earlier receipt has a higher discounted value than the same receipt later when testing a positive rate. Two portfolios with the same starting and ending balances can therefore have different XIRRs even when their total contributions and withdrawals match. The final balance measures value at one date. XIRR reflects the cash-flow history along the way.
Avoid double-counting and mismatched dates
Cash flows on a single date can be added together because they share the same discount period. A contribution of ₹5,000 and a receipt of ₹1,000 on the same date have a net flow of −₹4,000. Keep separate rows when you want to match your statements. The calculation groups entries that share a date before solving.
Use a valuation associated with a specific date. The closing balance and the date should come from the same statement or valuation record. If the full position was sold, enter the proceeds on the sale date using your chosen cash-flow convention and avoid adding a second row for the old market value of those shares.
Handle income consistently. If cash was paid out to you, include the receipt when estimating your overall return. If reinvested income is already reflected in the final value and never left the portfolio you are measuring, counting it as a separate positive receipt would overstate the cash you got out.
Interpret a missing or unusual result
Check that the net cash flows include both a negative and a positive amount on distinct dates. A list with only purchases needs a receipt or a final valuation. An annualised rate also depends on a measurable interval, so recording the contribution and the entire receipt on one date makes the rate uninformative.
With alternating contributions and receipts, some cash-flow patterns have multiple rates that satisfy the equation. This calculator searches a bounded range and may fail to find a result even if another solver reports one. Review the rows and the sign changes before interpreting an error. If the result is very high or low over a short period, verify the actual rupee change alongside the annualised number.
Once the rows are complete, add up the negative and positive cash flows separately. Include the final valuation when adding positive rows, and label it so you can distinguish cash already received from current holdings in your records. For a simple example, a ₹10,000 deposit followed exactly one year later by an ₹11,000 balance gives a ₹1,000 gain and 10% XIRR. The same gain realised after two years represents about 4.88% a year. Comparing both figures helps explain why the rate can change while the rupee gain stays the same.