Sub topic 5
Using Excel's NPV Function
This chapter assumes you can enter formulas and use ranges in Excel, and that you know compound interest and the idea of a discount rate. Earlier chapters defined NPV as the sum of discounted cash flows. This chapter covers how Excel's NPV function implements that sum, what it accepts, and where it fails quietly.
What the function computes
The syntax is:
=NPV(rate, value1, [value2], ...)NPV treats the values as a series of equally spaced cash flows. It discounts the first value by one full period, the second by two periods, and so on. For values v1 through vn, it returns:
NPV = v1/(1+rate)^1 + v2/(1+rate)^2 + ... + vn/(1+rate)^n
Three consequences follow from this definition:
- The function assumes every cash flow arrives at the end of its period.
- The function has no idea what your timeline looks like. It uses the position of each value in the list, not any date or period label next to it.
ratemust be a rate per period of the cash flows. Monthly flows need a monthly rate.
The next chapter covers the handling of a cash flow at t=0. Here, the examples keep the t=0 outflow in its own cell and outside the function's range.
A worked example
Suppose a project returns four annual cash flows, discounted at 8%.
A1: Discount rate B1: 8%
A3: Period 0 B3: -10000
A4: 1 B4: 3000
A5: 2 B5: 4000
A6: 3 B6: 4000
A7: 4 B7: 3000
PV of the four inflows:
=NPV(B1, B4:B7)
Project NPV:
=NPV(B1, B4:B7) + B3The first formula returns about 11,587.55. Adding the t=0 outflow of -10,000 gives an NPV of about 1,587.55. A positive NPV means the project earns more than the 8% required return, after accounting for timing.
Checking the function by hand
You can reproduce NPV with SUMPRODUCT and an explicit period column. This is useful for audits, because every discount exponent is visible.
Period numbers in A4:A7 are 1, 2, 3, 4
Manual PV of the inflows:
=SUMPRODUCT(B4:B7 / (1 + B1)^A4:A7)
Difference from the function (should be about 0):
=NPV(B1, B4:B7) - SUMPRODUCT(B4:B7 / (1 + B1)^A4:A7)If the two results differ, a period label or a range is wrong. Because the manual version reads exponents from column A, it shows right away when your periods do not run 1, 2, 3, ... as NPV assumes.
What the arguments may contain
NPV accepts up to 254 value arguments. Each argument can be a single cell, a range, or a literal number. Its handling of non-numeric content is the source of many silent errors.
| Content in a referenced range | What NPV does |
|---|---|
| Number | Discounted by its position |
| Empty cell | Ignored, and the later values do **not** move up a period |
| Text, including numbers stored as text | Ignored |
| TRUE or FALSE inside a range | Ignored |
| TRUE, FALSE, or text typed directly as an argument | Counted as a number or evaluated |
| Error value such as #DIV/0! | Result is that error |
The empty-cell rule needs a closer look. In current Excel, blank cells inside a range are skipped in the count of periods as well. A blank year in the middle of your series therefore shifts every later cash flow one period earlier. If a project has no cash flow in year 2, enter 0, not nothing.
Wrong: B5 is blank, so year 3 and 4 flows are discounted one period too little
=NPV(B1, B4:B7)
Right: B5 contains 0
=NPV(B1, B4:B7)Numbers stored as text are the other common trap. A cash flow imported from a CSV file can look like a number, left-aligned or with a green corner flag, and NPV will skip it with no warning. Check with =COUNT(B4:B7), which should equal the number of periods you expect.
Should return 4 for four periods; anything less means a value was skipped:
=COUNT(B4:B7)
Guard that fails loudly instead of silently:
=IF(COUNT(B4:B7) = ROWS(B4:B7), NPV(B1, B4:B7) + B3, NA())Matching the rate to the period
The rate must match the spacing of the cash flows. With monthly cash flows and a 9% annual rate, you have two ways to convert it:
B1: Annual rate = 9%
Effective monthly rate (compounds back to exactly 9% per year):
=(1 + B1)^(1/12) - 1
Nominal monthly rate (compounds to slightly more than 9% per year):
=B1/12Use the effective conversion when 9% is an effective annual return. Use the nominal conversion when the rate is quoted as a nominal annual rate compounded monthly, as on many loans. Whichever you choose, document it in the model. The two give different NPVs, and the difference grows with the rate and the horizon.
Non-contiguous and combined inputs
Because NPV accepts several arguments, you can pass separate ranges. Excel reads them in order, as one continuous series.
Years 1-2 in B4:B5, years 3-4 in B8:B9. Treated as one series of four periods:
=NPV(B1, B4:B5, B8:B9)Any cells between the ranges that you leave out are not counted as periods. Make sure the ranges you pass really are consecutive periods.
You can also add a terminal value to the last period by including it as a separate argument only if it arrives in its own period. If it arrives with the final cash flow, add it in that cell instead:
Terminal value in D1 received at the end of year 4, same time as B7:
=NPV(B1, B4:B6, B7 + D1) + B3Sensitivity to the rate
NPV falls as the discount rate rises, because later cash flows lose more value. A column of rates gives a quick sensitivity table:
A10:A14 hold rates: 4%, 6%, 8%, 10%, 12%
In B10, fill down to B14:
=NPV($A10, $B$4:$B$7) + $B$3The anchored references ($B$4:$B$7) keep the cash flows fixed while the rate changes by row. Where the column crosses zero, you have found the internal rate of return, covered in a later chapter.
Common errors with NPV
- #VALUE! appears when a typed argument cannot be read as a number, or when the rate is text such as "8 percent". A rate of 8 instead of 8% is not an error, but it means 800%, so confirm the cell is formatted as a percentage and holds 0.08.
- #NUM! is uncommon in
NPV. It can appear if the rate is -100% or lower, which makes the discount factor zero or undefined. - Wrong, plausible result is the main danger. Skipped text, blanks inside the range, a mismatched rate period, and a misplaced t=0 flow all produce a number that looks fine.
Limits of the function
NPV handles only evenly spaced flows. If cash flows fall on irregular dates, such as an invoice paid on 17 March and another on 2 July, NPV will treat them as equally spaced and misstate the value. A later chapter introduces XNPV for that case.
Exercise
A project has an outflow of -5,000 today (B2), then inflows in B3:B6 of 1,500, (blank), 2,500 and 2,500 for years 1 to 4. The rate in B1 is 10%. Someone writes =NPV(B1, B3:B6) + B2. Describe the error, say which cash flows are mis-timed, and give the corrected approach.
Show answer
The blank cell for year 2 is skipped, so the 2,500 flows from years 3 and 4 are treated as years 2 and 3, and one 2,500 flow moves up a period, which makes the result too high. The year 4 flow is also discounted too little. Enter 0 in the year 2 cell so that B3:B6 holds four numeric periods, then use =NPV(B1, B3:B6) + B2. Check with =COUNT(B3:B6), which should return 4.
Exercise
Monthly cash flows are in C4:C15 and the effective annual discount rate is 12% in B1. Write the formula for the PV of the twelve inflows.
Show answer
=NPV((1 + B1)^(1/12) - 1, C4:C15). The rate is converted to an effective monthly rate, because NPV needs a rate per period of the cash flows. Using B1 directly would discount monthly flows at 12% per month.