body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.calculator-wrapper {
background: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 8px;
padding: 30px;
margin-bottom: 40px;
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.calc-title {
text-align: center;
margin-bottom: 25px;
color: #2c3e50;
}
.input-group {
margin-bottom: 15px;
}
.input-group label {
display: block;
margin-bottom: 5px;
font-weight: 600;
font-size: 0.9em;
}
.input-group input {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
box-sizing: border-box;
}
.row {
display: flex;
gap: 20px;
flex-wrap: wrap;
}
.col {
flex: 1;
min-width: 200px;
}
.cf-section {
background: #ffffff;
padding: 15px;
border-radius: 6px;
border: 1px solid #dee2e6;
margin-top: 20px;
}
.cf-title {
font-weight: bold;
margin-bottom: 10px;
border-bottom: 2px solid #eee;
padding-bottom: 5px;
}
button.calc-btn {
background-color: #0056b3;
color: white;
border: none;
padding: 15px 30px;
font-size: 18px;
border-radius: 4px;
cursor: pointer;
width: 100%;
margin-top: 20px;
transition: background 0.3s;
}
button.calc-btn:hover {
background-color: #004494;
}
.results-area {
margin-top: 25px;
padding: 20px;
background: #fff;
border-left: 5px solid #0056b3;
display: none;
}
.result-row {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
padding-bottom: 10px;
border-bottom: 1px solid #eee;
}
.result-row.final {
font-size: 1.2em;
font-weight: bold;
color: #0056b3;
border-bottom: none;
margin-top: 15px;
}
.article-content h2 {
margin-top: 30px;
color: #2c3e50;
}
.article-content h3 {
color: #34495e;
}
.article-content code {
background: #f1f1f1;
padding: 2px 5px;
border-radius: 3px;
font-family: monospace;
color: #d63384;
}
.explanation-box {
background-color: #e8f4fd;
padding: 15px;
border-radius: 5px;
margin: 20px 0;
border-left: 4px solid #3498db;
}
function calculateNPV() {
// Get Inputs
var initialOutlay = parseFloat(document.getElementById('initialOutlay').value) || 0;
var ratePercent = parseFloat(document.getElementById('discountRate').value) || 0;
var cf1 = parseFloat(document.getElementById('cf1').value) || 0;
var cf2 = parseFloat(document.getElementById('cf2').value) || 0;
var cf3 = parseFloat(document.getElementById('cf3').value) || 0;
var cf4 = parseFloat(document.getElementById('cf4').value) || 0;
var cf5 = parseFloat(document.getElementById('cf5').value) || 0;
// Convert rate percentage to decimal
var r = ratePercent / 100;
// Calculate Present Value for each year
// Formula: PV = CashFlow / (1 + r)^n
var pv1 = cf1 / Math.pow((1 + r), 1);
var pv2 = cf2 / Math.pow((1 + r), 2);
var pv3 = cf3 / Math.pow((1 + r), 3);
var pv4 = cf4 / Math.pow((1 + r), 4);
var pv5 = cf5 / Math.pow((1 + r), 5);
// Sum of PVs
var sumPV = pv1 + pv2 + pv3 + pv4 + pv5;
// Calculate NPV
// NPV = Sum of Future PVs – Initial Investment
var npv = sumPV – initialOutlay;
// Display Logic
document.getElementById('results').style.display = 'block';
// Formatting function for currency
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
});
document.getElementById('pvSum').innerText = formatter.format(sumPV);
document.getElementById('initialDisplay').innerText = "-" + formatter.format(initialOutlay);
document.getElementById('npvResult').innerText = formatter.format(npv);
// Show specific message if the rate is extremely high (simulating infinity)
// If the sum of PVs is essentially 0 despite having cash flows, it's effectively infinite decay.
var totalCF = cf1 + cf2 + cf3 + cf4 + cf5;
if (totalCF > 0 && sumPV < 0.01) {
document.getElementById('infiniteWarning').style.display = 'block';
} else {
document.getElementById('infiniteWarning').style.display = 'none';
}
}
How to Calculate NPV with Infinite Discount Rate in Excel
Net Present Value (NPV) is a core component of corporate finance and investment analysis. It determines the value of a series of future cash flows in today's dollars. But what happens when you push the theoretical limits of the formula? Understanding how to calculate NPV with an "infinite" discount rate in Excel serves as a crucial exercise in understanding the time value of money and the impact of extreme risk or hyperinflation.
The Theoretical Limit: As the discount rate approaches infinity ($r \to \infty$), the denominator in the PV formula $(1+r)^n$ becomes infinitely large. Consequently, the present value of any future cash flow approaches zero.
The Mathematical Concept
The standard formula for NPV is:
$$NPV = \sum \frac{CF_t}{(1+r)^t} – I_0$$
Where:
- CF = Cash Flow in period t
- r = Discount Rate
- t = Time period
- I_0 = Initial Investment
When r becomes extremely large (simulating infinity), the fraction $\frac{CF_t}{(1+r)^t}$ becomes 0. Therefore, the equation simplifies to:
NPV ≈ -Initial Investment
Implementing in Excel
Since Excel cannot handle a literal "Infinite" value in calculations (it will return a #NUM! or #VALUE! error if you try to divide by zero or use non-numeric strings), you must simulate infinity using a sufficiently large number.
Step 1: Setup Your Data
Organize your spreadsheet with the initial investment in one cell and subsequent cash flows in adjacent cells.
- A1: Discount Rate
- A2: Initial Investment (e.g., 5000)
- A3: Year 1 Cash Flow
- A4: Year 2 Cash Flow
- A5: Year 3 Cash Flow
Step 2: Define "Infinity"
In cell A1, do not type the symbol ∞. Instead, input a very large percentage that makes future values negligible. Good examples include:
100000%
9.99E+100 (Scientific notation for a massive number)
Step 3: The Excel Formula
Use the standard NPV function syntax:
=NPV(A1, A3, A4, A5) - A2
Note: Excel's NPV function assumes the first value inside the parenthesis occurs at the end of period 1. Therefore, the initial investment (Year 0) is subtracted outside the function.
Interpreting the Result
If you use the calculator above and set the Discount Rate to a massive number (e.g., 1,000,000%), you will notice that the Present Value of Future Cash Flows becomes $0.00.
This means the project has no value beyond the cash you hold right now. In a scenario with an infinite discount rate, deferring consumption or investment is strictly penalized; money available tomorrow is considered worthless compared to money available today. This effectively renders any investment with an upfront cost unviable, as the NPV will equal the negative cost of that investment.
When is this useful?
While an infinite discount rate is impossible in stable markets, this calculation helps in:
- Stress Testing: Checking model behavior under extreme hyperinflation scenarios.
- Liquidation Analysis: Evaluating scenarios where future operations are deemed to have zero certainty or value.
- Model Auditing: Verifying that an NPV model is built correctly; if the rate is set to max and the result isn't exactly the negative initial outlay, there may be a logic error in the spreadsheet.