NPV and IRR on the HP 12C with uneven cash flows (CFo, CFj, Nj)
Clear everything with f CLEAR REG, enter the initial flow with g CFo (negative for an investment), each later flow with g CFj (g Nj repeats one), the rate in i, then f NPV (16,748.73) and f IRR (21.84%).
fCLEAR REGCLx50000CHSgPVCF₀15000gPMTCFj18000gPMTCFj3gFVNj20000gPMTCFj10ifNPVPVfIRRFV
The HP 12C keeps cash flows in its storage registers: gPVCF₀ (CFo) stores the flow at time 0, each gPMTCFj (CFj) stores the next one, and gFVNj (Nj) says how many times in a row the last one repeats. fNPVPV then gives the NPV at the rate in i, and fIRRFV the IRR.
Example: NPV and IRR of a project
A project costs 50,000 today and returns 15,000 in year 1, 18,000 in each of years 2 to 4, and 20,000 in year 5. Is it worth it at a 10% cost of capital, and what is its IRR?
| Step | Keys | Display shows | What it does |
|---|---|---|---|
| 1 | fCLEAR REGCLx | 0.00 | CLEAR REG: erase old cash flows and registers. |
| 2 | 50000CHSgPVCF₀ | -50,000.00 | CF0: the investment today, negative. |
| 3 | 15000gPMTCFj | 15,000.00 | CF1: year 1. |
| 4 | 18000gPMTCFj | 18,000.00 | CF2: year 2. |
| 5 | 3gFVNj | 3.00 | Nj: the 18,000 happens 3 times in a row (years 2, 3 and 4). |
| 6 | 20000gPMTCFj | 20,000.00 | The flow of year 5. |
| 7 | 10i | 10.00 | Discount rate: 10% per period. |
| 8 | fNPVPV | 16,748.73 | NPV at 10%. |
| 9 | fIRRFV | 21.84 | IRR in % per period (the display may show "running" for a few seconds on a real calculator). |
The NPV at 10% is 16,748.73: positive, so the project earns more than 10%. The IRR is 21.84% a year. Both are "per period": with monthly flows, i and the IRR are monthly rates.
Got a different number?
These are the wrong results this example gives when one thing is off. Each one was produced by replaying the mistake on our engine.
| You see | Why | Fix |
|---|---|---|
| 116,748.73 | CF0 was entered as positive (CHS forgotten), so the investment is counted as money received. | Key the investment with CHS before gPVCF₀. With every flow positive, IRR gives Error 7. |
| -6,461.31 | The 18,000 was entered once without Nj, so years 3 and 4 are missing and the 20,000 lands in year 3. | After a repeated flow press 3gFVNj, or press 18000gPMTCFj three times. |
| 38,723.66 | The rate was keyed as a decimal (0.1). i takes percent. | 10i for 10%. |
| 0.00 | PV was pressed without f. That stores or computes the TVM present value, not the NPV. | NPV is the gold function: fNPVPV. |
Checking what you entered
The HP 12C reviews flows from the last one back: RCLgFVNj shows the Nj of flow n, and RCLgPMTCFj shows flow n and lowers n by one. Because n goes down, store the number of flows in n again when you finish.
| Step | Keys | Display shows | What it does |
|---|---|---|---|
| 1 | RCLn | 3.00 | How many flows (groups) follow CF0: 3 (15,000; 18,000 × 3; 20,000). |
| 2 | RCLgFVNj | 1.00 | Nj of the last flow. |
| 3 | RCLgPMTCFj | 20,000.00 | The last flow; n drops to 2. |
| 4 | RCLgFVNj | 3.00 | Nj of flow 2. |
| 5 | RCLgPMTCFj | 18,000.00 | Flow 2; n drops to 1. |
| 6 | 3n | 3.00 | Put the count back before computing NPV or IRR. |
To correct a flow, store the new amount in its register: 16000STO2 replaces flow 2. If an Nj or the order is wrong, the simplest fix is fCLEAR REGCLx and entering the flows again.
Limits and messages
- Up to 20 flows after CF0 (Nj groups count as one), each repeated up to 99 times. More than that gives Error 6.
- Error 7 from IRR: the flows do not change sign (every flow positive, or every one negative).
- Error 3 from IRR: the calculator could not find an answer, which can happen when the flows change sign more than once. Key a guess for the rate and press RCLgR/SPSE to search from it.
See all messages on HP 12C error codes.
Related
How we checked this page: every display above comes from replaying the keys on a tested engine, and the final answer is compared with an independent formula. How we check every answer.