function calculateEPSGrowth() {
// Get input elements by ID strictly matching HTML
var initialInput = document.getElementById('initialEPS');
var finalInput = document.getElementById('finalEPS');
var yearsInput = document.getElementById('yearsPeriod');
var errorDiv = document.getElementById('errorMessage');
var resultDiv = document.getElementById('resultsDisplay');
var cagrDisplay = document.getElementById('cagrResult');
var totalDisplay = document.getElementById('totalGrowthResult');
var absDisplay = document.getElementById('absChangeResult');
// Reset previous states
errorDiv.style.display = 'none';
resultDiv.style.display = 'none';
cagrDisplay.className = 'result-value';
totalDisplay.className = 'result-value';
// Parse Values
var startVal = parseFloat(initialInput.value);
var endVal = parseFloat(finalInput.value);
var years = parseFloat(yearsInput.value);
// Validation
if (isNaN(startVal) || isNaN(endVal) || isNaN(years)) {
errorDiv.innerText = "Please enter valid numeric values for all fields.";
errorDiv.style.display = 'block';
return;
}
if (years 0) ? 1000 : 0; // simplified handling for display
}
// 2. CAGR (Compound Annual Growth Rate)
// Formula: (Final / Initial)^(1/n) – 1
// Note: CAGR formula fails if Start or End values are negative.
var cagr = 0;
var cagrValid = true;
if (startVal <= 0 || endVal <= 0) {
cagrValid = false; // Standard CAGR cannot calculate negative earnings transitions
} else {
cagr = (Math.pow((endVal / startVal), (1 / years)) – 1) * 100;
}
// 3. Absolute Change per Year
var absChange = (endVal – startVal) / years;
// Display Results
// Handle Total Growth Display
totalDisplay.innerText = totalGrowth.toFixed(2) + "%";
if (totalGrowth < 0) totalDisplay.className += " negative";
// Handle CAGR Display
if (cagrValid) {
cagrDisplay.innerText = cagr.toFixed(2) + "%";
if (cagr < 0) cagrDisplay.className += " negative";
} else {
cagrDisplay.innerText = "N/A (Negative EPS)";
// Add a small note if needed via innerHTML or leave as N/A
}
// Handle Absolute Change Display
absDisplay.innerText = "$" + absChange.toFixed(2) + " / year";
if (absChange < 0) absDisplay.className += " negative";
resultDiv.style.display = 'block';
}
How to Calculate 5-Year EPS Growth Rate
Earnings Per Share (EPS) is one of the most critical metrics for investors assessing a company's profitability. Calculating the 5-year EPS growth rate helps identify whether a company is expanding its bottom line consistently over time. This guide explains how to calculate this metric using the Compound Annual Growth Rate (CAGR) formula.
Why Use a 5-Year Period?
Short-term earnings can be volatile due to one-time events, economic cycles, or accounting adjustments. Analyzing a 5-year period smooths out these irregularities, providing a clearer picture of the company's long-term trend. Consistent growth over five years suggests a durable competitive advantage.
The Formula: CAGR
The standard method to calculate growth over multiple years is the Compound Annual Growth Rate (CAGR). This formula assumes the investment grew at a steady rate each year.
CAGR = ( Ending Value / Beginning Value )1 / n – 1
Where:
Ending Value: The EPS of the most recent year (Year 5).
Beginning Value: The EPS from the start of the period (Year 0).
n: The number of years (usually 5).
Step-by-Step Calculation Example
Let's say you want to calculate the 5-year growth rate for Company XYZ.
Initial EPS (2018): $2.50
Final EPS (2023): $4.10
Number of Years: 5
Step 1: Divide Final by Initial
4.10 / 2.50 = 1.64
Step 2: Raise to the power of (1/5)
(1/5) is 0.2.
1.640.2 ≈ 1.104
Step 3: Subtract 1
1.104 – 1 = 0.104
Step 4: Convert to Percentage
0.104 * 100 = 10.4%
This means Company XYZ grew its earnings at an average compounded rate of 10.4% per year over the last 5 years.
Limitations and Edge Cases
While the CAGR formula is powerful, it has mathematical limitations regarding negative numbers:
Negative EPS: If the starting EPS is negative (a loss) and the ending EPS is positive, the standard CAGR formula cannot be used because it requires calculating the root of a negative number. In these cases, investors often look at absolute dollar change or look for a turnaround point where earnings became positive.
Volatile Earnings: A 5-year CAGR compares only the start and end points. It ignores what happened in years 2, 3, and 4. A company could have had massive losses in the middle years and still show a positive CAGR if the end year was strong.
Interpreting the Results
Generally, investors look for the following benchmarks:
5-10%: Stable, mature growth (typical of defensive blue-chip stocks).
10-20%: Strong growth (typical of successful expansion phases).
20%+: Aggressive growth (often seen in tech or early-stage winners, but harder to sustain).