function calculateGrowthRate() {
// Retrieve input values
var startVal = parseFloat(document.getElementById("startValue").value);
var endVal = parseFloat(document.getElementById("endValue").value);
var years = parseFloat(document.getElementById("numYears").value);
// DOM elements for output
var resultBox = document.getElementById("resultBox");
var cagrDisplay = document.getElementById("cagrResult");
var summaryDisplay = document.getElementById("growthSummary");
var errorMsg = document.getElementById("errorMsg");
// Reset display
resultBox.style.display = "none";
errorMsg.style.display = "none";
errorMsg.innerText = "";
// Validation logic
if (isNaN(startVal) || isNaN(endVal) || isNaN(years)) {
errorMsg.innerText = "Please enter valid numbers in all fields.";
errorMsg.style.display = "block";
return;
}
if (years <= 0) {
errorMsg.innerText = "The number of years must be greater than zero.";
errorMsg.style.display = "block";
return;
}
if (startVal <= 0) {
errorMsg.innerText = "The beginning value must be greater than zero to calculate a growth percentage.";
errorMsg.style.display = "block";
return;
}
// Calculation Logic: CAGR = (Ending Value / Beginning Value)^(1/n) – 1
var ratio = endVal / startVal;
var exponent = 1 / years;
var cagrDecimal = Math.pow(ratio, exponent) – 1;
var cagrPercent = cagrDecimal * 100;
// Determine total growth percentage for summary
var totalGrowth = ((endVal – startVal) / startVal) * 100;
// Update UI
cagrDisplay.innerText = cagrPercent.toFixed(2) + "%";
var summaryText = "Your value grew from " + startVal.toLocaleString() + " to " + endVal.toLocaleString() + " over " + years + " years.";
summaryText += "Total Absolute Growth: " + totalGrowth.toFixed(2) + "%";
summaryDisplay.innerHTML = summaryText;
resultBox.style.display = "block";
}
How to Calculate Average Growth Rate Over Multiple Years
Calculating the growth of an investment, business revenue, or user base over a single year is a simple percentage calculation. However, when you need to understand performance over multiple years, simple averages can be misleading. This is where the Compound Annual Growth Rate (CAGR) becomes the gold standard metric.
The calculator above helps you determine the smoothed annual rate of growth required for a starting value to reach an ending value over a specific period of time.
What is CAGR?
The Compound Annual Growth Rate (CAGR) is a business and investing term for the geometric progression ratio that provides a constant rate of return over the time period. Unlike a simple average, which ignores the compounding effect, CAGR assumes that the growth in the first year is added to the base for the second year, and so on.
It answers the question: "If this investment had grown at a steady, unchanging rate every single year, what would that rate be?"
The Formula for Multi-Year Growth
To calculate the average growth rate over multiple years manually, you use the following formula:
CAGR = ( Ending Value / Beginning Value )1 / n – 1
Where:
Ending Value: The value at the end of the period (Revenue, Portfolio Balance, etc.).
Beginning Value: The value at the start of the period.
n: The number of years (or periods) involved.
Step-by-Step Example
Let's say you invested 10,000 in a tech startup. Five years later, your stake is worth 25,000. You want to know the annual growth rate.
Identify Variables: Start = 10,000, End = 25,000, Years = 5.
Calculate Ratio: 25,000 / 10,000 = 2.5.
Calculate Exponent: 1 / 5 = 0.2.
Apply Exponent: 2.50.2 ≈ 1.2011.
Subtract 1: 1.2011 – 1 = 0.2011.
Convert to Percent: 0.2011 * 100 = 20.11%.
This means your investment grew at an effective rate of 20.11% every year for 5 years.
When to Use This Calculation
This metric is essential in various scenarios:
Investment Analysis: Comparing the performance of two different assets (e.g., Real Estate vs. Stocks) over different time horizons.
Business Metrics: Analyzing revenue growth, subscriber counts, or website traffic over a 3-5 year strategic plan.
Inflation Adjustment: Determining if your salary or savings are keeping up with the multi-year inflation rate.
Difference Between AAGR and CAGR
The Average Annual Growth Rate (AAGR) is a simple arithmetic mean of the growth rates for each year. It is easier to calculate but often overstates the actual returns because it does not account for compounding or volatility.
CAGR is a geometric mean. It is generally considered more accurate for financial and business modeling because it smooths out the "noise" of volatility, giving you a single number that represents the effective growth from Point A to Point B.