Skip to content
AZ Tools

NPV & IRR Calculator (with XIRR)

Net present value, every IRR, MIRR and payback for a list of cash flows — or XNPV and XIRR for dated ones — with the Excel NPV() trap shown.

NPV (first flow today)
What Excel's NPV() returns
IRR
MIRR
Payback
Discounted payback

Excel's NPV() treats its first value as one period away and discounts it too. Pass it the later flows and add the first one outside the function to get the NPV on the left.

NPV at each discount rate — dots mark where it crosses zero, the dashed line is your rate
-20%50%

Everything is calculated in the browser. The flows and rates are kept in local storage so they survive a reload.

How to use

  1. Paste one cash flow per line, starting with today's outflow as a negative number; commas for thousands and accounting brackets are accepted.
  2. Set the discount rate per period and read the NPV, and compare it with the Excel NPV() figure beside it if you are checking a spreadsheet.
  3. Read the IRR box: more than one rate means the flows change sign more than once, and the chart shows where each crossing is.
  4. Set the finance and reinvestment rates for MIRR if your borrowing and investing rates differ from the discount rate.
  5. For irregular dates, switch to dated and write YYYY-MM-DD followed by the amount on each line to get XNPV and XIRR.

About this tool

Show

Paste a column of cash flows and get the net present value at your discount rate, every internal rate of return, the modified IRR and the simple and discounted payback periods, or switch to dated flows for XNPV and XIRR. The first line is today and is not discounted, which is the textbook convention and not what Excel's NPV() does: that function treats its first argument as one period away and discounts it too, so passing it the whole list understates the answer by a factor of one plus the rate. Both figures are shown side by side so the discrepancy is visible rather than inherited. An IRR is a root of a polynomial, and a polynomial can have several. When the flows change sign more than once — a mine that needs closing costs, a project with a mid-life refit — there can be one IRR per change, and Excel returns whichever one its starting guess leads to. This tool scans every rate from −99.99% to 10,000% and lists each place the NPV crosses zero; the classic pump example of −1,600, 10,000, −10,000 has two, 25% and 400%, and the chart shows why. A curve that only touches zero without crossing is not reported. When there is no crossing at all it says so rather than printing an error code. MIRR replaces the IRR's assumption that cash is reinvested at the IRR itself with an explicit finance rate and reinvestment rate. Payback counts the last time the running total climbs through zero, interpolated within that period on the assumption that its cash arrives evenly, so a project that breaks even and sinks again has not paid back. Dated flows follow Excel's XNPV: days are counted from the first line and divided by 365 regardless of leap years, and a line dated earlier than the first is refused.

Frequently asked questions

Why is Excel's NPV different from this one?

Because Excel's NPV() assumes every value it is given arrives at the end of a period, starting one period from now. An initial investment made today is therefore discounted when it should not be. The correct spreadsheet pattern is =NPV(rate, later flows) + first flow. The value in the Excel box here is what the whole list returns inside NPV(), so if your spreadsheet shows that number, this is why.

Why are there two IRRs?

The IRR is a rate at which the NPV is zero, and the NPV is a polynomial in 1/(1+r). A polynomial can have as many positive roots as its coefficients have sign changes, so flows that go negative, positive and negative again can have two IRRs. Both are correct. That is the point where IRR stops being useful as a decision rule: read the NPV at the rate you actually face, or use MIRR, which has exactly one answer.

What does MIRR do differently?

It discounts all the outflows to today at a finance rate, compounds all the inflows to the final period at a reinvestment rate, and finds the single rate that turns one into the other. Plain IRR implicitly assumes the cash thrown off along the way is reinvested at the IRR itself, which flatters projects with a high IRR. With both rates equal to your cost of capital, MIRR is usually the more honest number.

How is the payback period calculated?

The running total of the flows is followed until it rises through zero for the last time, and the fraction of that period is found by linear interpolation, which assumes the period's cash arrives evenly. Discounted payback does the same with each flow discounted at your rate first, so it is always at least as long. If the running total ends negative the project never pays back, and the tool says so.

How does XIRR count time?

Like Excel: each flow is discounted by the number of days since the first line divided by 365, so a leap year is not treated as longer. The first line is day zero, which is why a line dated before it is refused — Excel returns an error in the same situation. Monthly flows entered with dates will give a slightly different answer from the periodic mode, because months are not equal lengths.

Related tools