How to Calculate Internal Rate of Return Using XIRR in Excel

When you are evaluating the profitability of a financial investment in Microsoft Excel, the standard Internal Rate of Return (IRR) function is frequently inadequate. The standard IRR function operates on a rigid assumption: it assumes that all cash flows (deposits and withdrawals) occur at perfectly equal, predictable intervals, such as exactly on the first of every month or exactly once a year. In the real world, investments are chaotic. You might invest capital on March 3rd, receive a dividend on July 14th, and inject more capital on November 2nd. To accurately calculate your return based on the exact dates money moved, you must upgrade to the XIRR function.

How the XIRR Function Works

The XIRR (Extended Internal Rate of Return) function calculates the annualized yield of an investment, but it pairs every single cash flow with a specific, exact calendar date, allowing it to calculate the precise time value of money down to the day.

The syntax requires two distinct columns of data: =XIRR(values, dates)

  1. values: A column containing your cash flows. Outflows (money you invested) must be entered as negative numbers (e.g., -5000). Inflows (money you received, or the final present value of the asset) must be positive numbers (e.g., 1500).
  2. dates: A parallel column containing the exact calendar date each transaction occurred.

How to Calculate XIRR

Imagine you bought $10,000 worth of stock on January 15, 2024. You received a $250 dividend on May 3, 2024. On December 12, 2024, you sold the entire portfolio for $11,500.

  1. In column A, list your dates: 1/15/2024, 5/3/2024, 12/12/2024.
  2. In column B, list the cash flows: -10000, 250, 11500.
  3. Click into an empty cell (e.g., C2) and type the formula: =XIRR(B1:B3, A1:A3)

Excel will analyze the exact number of days between each transaction and output a decimal (e.g., 0.1985). Click the % button on the Home ribbon to format this as a percentage. The result (19.85%) is your true annualized return.

Common XIRR Errors to Avoid

The XIRR function will crash and display a #NUM! or #VALUE! error if you violate any of its strict rules:

  • Negative Initial Value: The very first number in your “values” array must be a negative number (representing your initial investment leaving your pocket).
  • Chronological Order: While XIRR is smart, the very first date in the list must be the earliest date. The subsequent dates do not technically have to be perfectly sorted, but the initial investment date must be first.
  • Date Formatting: Ensure your dates are actually formatted as dates in Excel, not just plain text strings.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.