IRR Function in Excel

If you want to know what return a series of cash flows is actually earning you, like an investment that costs money up front and pays you back over several years, the IRR function works it out in one step.

IRR stands for internal rate of return. It’s the single interest rate at which all your cash flows, the money out and the money in, balance out to zero.

IRR returns a single rate, but it works happily inside dynamic array formulas like =IRR(FILTER(…)). I’ll show you that along with four other examples below.

IRR Function Syntax in Excel

Here is the syntax of the IRR function:

=IRR(values,[guess])
  • values: A range of cells with your cash flows. It needs at least one negative number (cash out) and one positive number (cash in), in date order.
  • [guess]: Optional. Your rough estimate of the rate. If you leave it out, Excel starts at 10%.

When to Use IRR Function

  • When you want the return rate on an investment that pays back over regular periods, like years or months.
  • When you’re comparing two projects and want to see which one earns more.
  • When you need a single number to judge whether a project clears your target return.
  • When your cash flows happen at even intervals (use XIRR instead if the dates are irregular).

Example 1: IRR of a Project’s Cash Flows

Let’s start with a straightforward project.

Below is the dataset. Column A lists the years and column B lists the cash flow for each year. Year 0 is the initial investment, shown as a negative number, followed by five years of returns.

Excel dataset showing Year 0 to 5 cash flows from -50000 to 24000 with a header for IRR calculation

I want the internal rate of return across the whole series in B2:B7.

Here is the formula:

=IRR(B2:B7)
Excel formula bar showing =IRR(B2:B7) with a resulting 20.5% IRR calculated from cash flows in cells B2 through B7

IRR looks at the 50,000 paid out and the growing returns that follow, then finds the rate that makes them balance. That works out to about 20.5%.

In plain terms, this project earns the equivalent of a 20.5% annual return. The first value has to be negative, since you can’t have a return without first putting money in.

Pro Tip: IRR returns a decimal, so format the cell as a percentage to read it as 20.5% instead of 0.205. Select the cell and press Ctrl + Shift + %.

Example 2: Compare Two Investment Options

IRR really earns its keep when you’re choosing between options.

Below is the dataset. Column A lists the years, and columns B and C hold the cash flows for two small businesses you could invest in: a cafe and a food truck.

IRR example 2 dataset showing cash flows for Cafe and Food Truck projects over five years in an Excel table

I want the IRR for each option so I can compare them side by side.

Here is the formula for the cafe:

=IRR(B2:B6)
Excel formula bar showing =IRR(B2:B6) applied to a cafe cash flow table with a calculated result of 7.1%

And here is the formula for the food truck:

=IRR(C2:C6)
Excel formula bar showing =IRR(C2:C6) applied to a food truck cash flow table with a calculated result of 19.1%

The cafe needs a bigger investment up front and returns about 7.1%. The food truck costs far less and returns about 19.1%.

Even though the cafe brings in more total cash, the food truck earns a much higher rate on the money you put in. That’s the kind of insight IRR is built for.

Example 3: Monthly IRR and Annualizing It

When your cash flows are monthly, IRR gives you a monthly rate. You usually want to turn that into an annual figure.

Below is the dataset. Column A lists the months and column B lists the monthly cash flow, starting with the amount paid out in month 0.

Excel dataset for IRR example 3 showing months 0-6 with cash flows and empty cells for monthly and annual IRR results

I want the monthly IRR first, then the annual rate that it works out to.

Here is the formula for the monthly IRR:

=IRR(B2:B8)
Excel formula bar showing =IRR(B2:B8) to calculate a 2.25% monthly IRR based on cash flows in column B

And here is the formula to annualize it:

=(1+D2)^12-1
Excel formula =(1+D2)^12-1 in cell E2 calculating annual IRR from a monthly IRR of 2.25% to get 30.6%

The first formula gives a monthly IRR of about 2.25%. The second compounds that across 12 months to get the true annual rate, about 30.6%.

Compounding is the right way to do this. Simply multiplying the monthly rate by 12 would overstate the return.

Example 4: IRR with a Mid-Project Investment

Real projects aren’t always one payment out followed by steady returns. Sometimes you put more money in partway through.

Below is the dataset. Column A lists the years and column B lists the cash flows, including an extra investment in Year 3 shown as a negative number.

Excel dataset for IRR example 4 showing years 0-6 with corresponding cash flows in columns A and B and an IRR header

I want the IRR across the full series, even with that mid-project outflow.

Here is the formula:

=IRR(B2:B8)
Excel formula bar showing =IRR(B2:B8) with the calculated 22.2% result in cell D2 for a cash flow table

IRR handles the mix of negatives and positives without any trouble, returning about 22.2%.

As long as the cash flows are in date order, IRR reads them just as they happen. The Year 3 top-up is simply treated as money going out in that period.

Example 5: IRR on a Dynamic Subset with FILTER

IRR doesn’t spill on its own, but you can feed it a dynamic array. Here we use FILTER to compute IRR through a chosen number of years.

Below is the dataset. Column A lists the year numbers, column B lists the cash flows, and cell D2 holds how many years to include.

Excel IRR example 5 dataset showing years 0-6 with cash flows and a Through Year value of 3

I want the IRR using only the cash flows up to the year number in D2, which is 3.

Here is the formula:

=IRR(FILTER(B2:B8,A2:A8<=D2))
Excel formula bar showing IRR function with FILTER to calculate internal rate of return for cash flows up to year 3

FILTER pulls the cash flows for years 0 through 3, and IRR finds the return across just that stretch, about 4.2%.

Raise D2 to include more years and the rate climbs as the later returns come in. It’s a quick way to see how the return builds over the life of a project.

Tips & Common Mistakes

  • A #NUM! error usually means there’s no sign change in your data. IRR needs at least one negative and one positive value to solve.
  • If you still get #NUM!, supply a guess close to your expected rate, like 0.05 or 0.5, to help Excel land on the right answer.
  • The order of the values matters. IRR treats them as one cash flow per period, so keep them in date order.
  • IRR ignores blank cells, text, and TRUE/FALSE values. If a period truly has no cash flow, enter a 0 so the timing stays correct.
  • IRR is closely tied to net present value. It’s simply the discount rate at which a project’s NPV comes out to zero.
  • When the gaps between cash flows are uneven, use XIRR instead. It takes actual dates and gives you an annual rate directly.

IRR turns a column of cash flows into a single number you can act on, which makes it one of the most useful functions for any kind of financial decision.

Work through the examples above and you’ll be comparing investments with confidence. For a step-by-step walkthrough, see our guide on how to calculate IRR in Excel.

List of All Excel Functions

Related Excel Functions / Articles:

I am a huge fan of Microsoft Excel and love sharing my knowledge through articles and tutorials. I work as a business analyst and use Microsoft Excel extensively in my daily tasks. My aim is to help you unleash the full potential of Excel and become a data-slaying wizard yourself.