function calculateDCF() {
var cf0 = parseFloat(document.getElementById('initialCashFlow').value);
var growth = parseFloat(document.getElementById('growthRate').value) / 100;
var discount = parseFloat(document.getElementById('discountRate').value) / 100;
var terminal = parseFloat(document.getElementById('terminalRate').value) / 100;
var years = parseInt(document.getElementById('projectionYears').value);
if (isNaN(cf0) || isNaN(growth) || isNaN(discount) || isNaN(terminal)) {
alert('Please enter valid numerical values.');
return;
}
if (discount <= terminal) {
alert('Discount Rate must be higher than the Terminal Growth Rate for the Gordon Growth Model to work.');
return;
}
var totalPV = 0;
var currentCF = cf0;
var yearlyData = "";
for (var i = 1; i <= years; i++) {
currentCF = currentCF * (1 + growth);
var pv = currentCF / Math.pow((1 + discount), i);
totalPV += pv;
}
var lastYearCF = currentCF;
var terminalValue = (lastYearCF * (1 + terminal)) / (discount – terminal);
var pvTerminalValue = terminalValue / Math.pow((1 + discount), years);
var intrinsicValue = totalPV + pvTerminalValue;
var resultDiv = document.getElementById('dcfResult');
var valuationOutput = document.getElementById('valuationOutput');
var breakdownOutput = document.getElementById('breakdownOutput');
resultDiv.style.display = 'block';
valuationOutput.innerHTML = "Intrinsic Enterprise Value: $" + intrinsicValue.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
breakdownOutput.innerHTML = "Analysis Breakdown:" +
"Sum of PV (Projection Period): $" + totalPV.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}) + "" +
"Terminal Value (Year " + years + "): $" + terminalValue.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}) + "" +
"PV of Terminal Value: $" + pvTerminalValue.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}) + "" +
"Note: This calculation assumes cash flows are generated at the end of each period.";
}
Understanding Discounted Cash Flow (DCF)
The Discounted Cash Flow (DCF) method is a valuation technique used to estimate the value of an investment based on its expected future cash flows. By using this calculator, investors can determine the "Intrinsic Value" of a company or project, essentially answering the question: "What is the total sum of all future money this business will generate, expressed in today's dollars?"
The Core Components
Initial Cash Flow: This is typically the Free Cash Flow (FCF) generated by the business in the most recent fiscal year.
Growth Rate: The expected percentage increase in cash flows during the projection period (Stage 1). High-growth companies often have rates exceeding 15%, while mature firms may be in the 5-8% range.
Discount Rate: Often calculated as the Weighted Average Cost of Capital (WACC), this represents the required rate of return. It accounts for the risk and the time value of money.
Terminal Growth Rate: The rate at which the company is expected to grow indefinitely after the projection period. This is usually tied to the long-term inflation rate or GDP growth (typically 2-3%).
The DCF Formula
Value = [CF1 / (1+r)^1] + [CF2 / (1+r)^2] + … + [CFn / (1+r)^n] + [Terminal Value / (1+r)^n]
Example Calculation
Imagine a company generating $100,000 in Free Cash Flow. You expect it to grow at 10% for the next 5 years. You require an 8% return (Discount Rate), and you expect the company to grow at 2% forever after that.
Projected Cash Flows: Years 1-5 would be calculated by growing the $100k by 10% annually.
Present Value: Each of those 5 cash flows is discounted back to today's value using the 8% rate.
Terminal Value: Using the Gordon Growth Model, we estimate the value of all cash flows from year 6 to infinity.
Summation: Adding the PV of the 5-year period and the PV of the Terminal Value gives you the total Intrinsic Value.
Why Use This Calculator?
DCF is widely considered the most rigorous way to value a business because it focuses on actual cash generation rather than accounting earnings or book value. It helps investors avoid overpaying for "hype" by anchoring the valuation in mathematical reality and required returns.