function calculateRevenueGrowth() {
var currentRevInput = document.getElementById('currentRevenue').value;
var previousRevInput = document.getElementById('previousRevenue').value;
var resultDiv = document.getElementById('rgr-result');
// Basic validation against empty inputs
if (currentRevInput === "" || previousRevInput === "") {
resultDiv.style.display = 'block';
resultDiv.innerHTML = 'Please enter both revenue figures.';
return;
}
var currentRev = parseFloat(currentRevInput);
var previousRev = parseFloat(previousRevInput);
// Validation for numeric inputs and edge cases
if (isNaN(currentRev) || isNaN(previousRev)) {
resultDiv.style.display = 'block';
resultDiv.innerHTML = 'Please enter valid numbers representing revenue.';
return;
}
if (previousRev === 0) {
resultDiv.style.display = 'block';
// Growth from zero is mathematically undefined for this formula context
resultDiv.innerHTML = 'Previous period revenue cannot be zero for growth rate calculation.';
return;
}
// The Revenue Growth Rate Formula
// ((Current Period – Previous Period) / Previous Period) * 100
var growthRateDecimal = (currentRev – previousRev) / previousRev;
var growthRatePercentage = growthRateDecimal * 100;
// Formatting the output
var formattedResult = growthRatePercentage.toFixed(2) + '%';
var labelText = growthRatePercentage > 0 ? "Revenue Growth:" : "Revenue Contraction:";
var outputColor = growthRatePercentage >= 0 ? "#28a745" : "#dc3545"; // Green for growth, red for contraction
resultDiv.style.display = 'block';
resultDiv.innerHTML = labelText + ' ' + formattedResult + '';
}
Understanding How to Calculate Revenue Growth Rate Formula
Tracking top-line revenue is crucial for any business, but knowing the raw numbers isn't enough. To understand the trajectory of your business, you need to calculate the revenue growth rate. This metric measures the percentage increase (or decrease) in revenue between two distinct periods, such as year-over-year (YoY) or quarter-over-quarter (QoQ).
A positive growth rate indicates expansion and increasing market share, while a negative rate signals contraction and potential issues that need addressing. Investors and stakeholders rely heavily on this figure to assess business health and future prospects.
The Revenue Growth Rate Formula
The math behind calculating revenue growth is straightforward. It involves comparing the revenue from the current period against the revenue from a corresponding previous period.
Revenue Growth Rate (%) = ((Current Period Revenue – Previous Period Revenue) / Previous Period Revenue) × 100
Practical Example Calculation
Let's assume you run a software company and want to calculate your Year-over-Year growth for 2023.
Current Period Revenue (2023): $1,500,000
Previous Period Revenue (2022): $1,200,000
Using the formula:
First, calculate the absolute difference: $1,500,000 – $1,200,000 = $300,000 (This is the raw growth amount).
Next, divide that difference by the previous period's revenue: $300,000 / $1,200,000 = 0.25.
Finally, multiply by 100 to get a percentage: 0.25 × 100 = 25%.
In this scenario, the company experienced a 25% revenue growth rate year-over-year.
Why Use This Calculator?
While the formula is simple, manually calculating it repeatedly for different periods (monthly, quarterly, annually) can lead to errors. This calculator provides instant, accurate results. Just plug in your revenue figures from the two periods you wish to compare, and the tool will handle the math, giving you a clear percentage indicator of your business trajectory.