You calculate IRR in Excel with =IRR(range) and NPV with =NPV(rate, range) — but there is one catch that trips up almost everyone: Excel's NPV function discounts the first cash flow as if it happened at the end of period 1. If your first cash flow is the initial investment at time zero, it must sit outside the NPV range and be added separately. Get that right and both functions behave exactly as finance textbooks describe. A few cell-level details and a sensible layout are all it takes.
What You'll Need
- Excel (or a compatible spreadsheet app) on Windows, macOS, or the web. The NPV and IRR functions are built into every standard version, no add-ins required.
- Your cash flow series as a list of numbers, one per period: an initial outflow (usually negative) followed by the inflows and outflows for each period in order.
- Dates or period labels to confirm your periods are evenly spaced (monthly, quarterly, annually). IRR and NPV assume equal intervals, so a gap breaks the math.
- A discount rate (also called required return or cost of capital) if you want NPV. IRR does not need one — it is the rate.
Step-by-Step
- Lay out your cash flows in a single column. Put period labels in column A (0, 1, 2, 3…) and cash flows in column B. Leave a header row. For example: B2 = -10000 (initial investment), B3 through B7 = the net cash flows for years 1–5. Keep them contiguous — no blank cells in the middle of the range.
- Sign the cash flows correctly. Money going out is negative, money coming in is positive. Every IRR and NPV problem needs at least one negative and one positive value. If the signs are flipped, the return will be inverted or the function will error.
- Check the spacing. Confirm in the period labels that each row represents one equal interval. If you have monthly data, every row is a month. If cash flows arrive at irregular dates, this function set will mislead you — use the XIRR and XNPV functions instead, which accept actual dates.
- Enter the IRR formula. In an empty cell, type
=IRR(B2:B7). Press Enter. Excel iterates to find the rate where NPV equals zero, then displays it as a decimal. It may return#NUM!if it cannot converge — covered below. - Format the result as a percentage. The raw output (say 0.1423) is correct but unreadable. Select the cell, open the Number format menu on the Home tab, and choose Percentage. Set two decimal places. Do the same for any rate cells you build.
- Ent, or verify, your discount rate. Put it in its own labeled cell, e.g. C1 = 0.10 for 10%. Keep it separate from the cash flows so you can change the assumption and watch NPV move.
- Enter the NPV formula the correct way. For cash flows at time zero through year 5 with the initial investment in B2:
=B2+NPV(C1,B3:B7). The initial outflow is added outside the NPV function; the remaining flows are the range. Press Enter. - Read the result. A positive NPV means the project earns more than your discount rate and is worth considering. A negative NPV means it falls short. NPV near zero means the project roughly matches your hurdle rate.
- Cross-check the two functions. Substitute the IRR result into the NPV formula as the rate. NPV should come out very close to zero (within a tiny rounding difference). If it does not, you have a range or sign error.
- Build a sensitivity check (optional but useful). Copy the NPV formula down a column while changing only the discount rate in the formula. This shows how much the decision depends on your rate assumption — a project with strongly positive NPV at many rates is more robust than one that flips sign with a small rate change.
- Label everything and lock the inputs. Give each output cell a clear header ("IRR", "NPV at 10%") and consider shading input cells so others know what they can change. This is the difference between a working model and a mystery.
Common Mistakes
- Including the initial investment inside the NPV range.
=NPV(rate, B2:B7)discounts the time-zero outflow by one period, understating NPV. The fix is=B2+NPV(rate, B3:B7). - Forgetting to add the initial outflow at all. Some users run NPV only on the inflows and get a large positive number that ignores the cost. Always include every cash flow.
- Mixing signs or leaving a positive investment amount. If the initial outflow is entered as +10000 instead of -10000, IRR will return a nonsensical or errored result.
- Using annual formatting on monthly data. A 1% monthly return is not a 1% annual return. Either keep periods consistent throughout or convert deliberately. NPV and IRR output rates per period, so label them "per month" or "per year" to avoid confusion.
- Blank cells inside the range. A blank is read as zero, which changes both the timing and the number of periods. Keep the series dense.
- Assuming IRR is unique. When cash flows change sign more than once, several IRRs can mathematically exist. Excel returns one based on its starting guess. Trust NPV for the decision in those cases.
Tips
- Use
=IRR(range, guess)with a starting guess like 0.1 when the default fails to converge. A reasonable guess often finds the answer on the first pass. - Name your ranges (Formulas tab, Define Name) so formulas read as
=IRR(CashFlows)instead of a cell reference. It reduces range-selection errors when the sheet grows. - Show both NPV and IRR side by side. NPV tells you the value created in currency; IRR tells you the percentage return. Use NPV to choose between projects of different sizes, since a bigger project can have a lower IRR but add more value.
- If your cash flows arrive on real calendar dates, switch to
=XNPV(rate, values, dates)and=XIRR(values, dates). These handle unequal spacing properly. Both need the values and dates ranges to line up row for row. - Pair NPV with a simple payback or breakeven check. A project can post a small positive NPV and still take years to recover its cash, which may not suit your situation.
Troubleshooting
If #NUM! appears from IRR, Excel could not converge on a rate. Add a guess argument (try 0.1, then -0.1), or widen the guess until it settles. Check first that the range contains both a negative and a positive value — with all-positive flows, no real IRR exists and the error is correct.
If #VALUE! appears, the range contains text or an empty-looking cell with a space in it. Select the range and confirm every cell is a number. Re-enter the affected cells as plain numbers.
If NPV returns a value that swings wildly when you change the rate slightly, re-check whether the initial investment is inside the range. Also confirm the rate cell is formatted as a number or percentage, not text — a rate stored as text is often read as zero, making NPV equal the undiscounted sum.
If the cross-check between IRR and NPV fails, list both ranges next to each other and compare row by row. The most common cause is an off-by-one: NPV starting at row 3 versus row 2, or IRR missing the last cash flow. Fix the ranges so both functions see the same set of flows, with time-zero handled outside NPV only.
If results look too good, verify no cash flow was entered twice and that outflows carry minus signs. A single sign error can turn a losing project into an apparently profitable one.
Frequently Asked Questions
Why does my NPV differ from a hand calculation?
Almost always because the initial investment was included inside the NPV range and discounted once, or because a different start period was assumed. Compare how each method treats time zero; the formulas match once that is aligned.
Can IRR be negative?
Yes. If the project loses money overall, IRR comes out below zero. A negative IRR simply means the return is worse than zero — the investment does not recover its cost under the stated flows.
Should I use IRR or NPV to decide?
NPV is the more reliable decision rule, especially when comparing projects of different sizes or when cash flows change sign more than once. Use IRR as a quick, intuitive percentage alongside it.
Do IRR and NPV use the same cash flows?
They should. Feed both the same series. The only structural difference is that NPV needs the time-zero flow handled separately, while IRR accepts the full column including time zero.
What if my cash flows are monthly?
The functions still work; the returned rate is per month. To express it annually, compound it rather than multiply by 12, and label the result so readers know which basis applies.
Does this work in Google Sheets or Excel Online?
Yes, both support NPV, IRR, XNPV and XIRR with the same syntax, including the time-zero treatment for NPV.