function calculateAttrition() {
// 1. Get input values
var startCount = document.getElementById('empStart').value;
var endCount = document.getElementById('empEnd').value;
var leftCount = document.getElementById('separations').value;
// 2. Validate inputs
if (startCount === "" || endCount === "" || leftCount === "") {
alert("Please fill in all fields to calculate the attrition rate.");
return;
}
var start = parseFloat(startCount);
var end = parseFloat(endCount);
var left = parseFloat(leftCount);
if (start < 0 || end < 0 || left < 0) {
alert("Employee counts and separations cannot be negative.");
return;
}
// 3. Calculate Average Number of Employees
// Formula: (Start + End) / 2
var averageEmployees = (start + end) / 2;
if (averageEmployees === 0) {
alert("Average workforce size is zero. Cannot calculate attrition rate.");
return;
}
// 4. Calculate Attrition Rate
// Formula: (Separations / Average Employees) * 100
var rate = (left / averageEmployees) * 100;
// 5. Display Results
document.getElementById('avgEmployees').innerText = averageEmployees.toLocaleString(undefined, { maximumFractionDigits: 1 });
document.getElementById('finalRate').innerText = rate.toFixed(2) + "%";
// Show result container
document.getElementById('attritionResults').style.display = 'block';
}
How to Calculate Rate of Attrition
Calculating the rate of attrition (also known as the churn rate or turnover rate) is a fundamental HR task. It allows businesses to understand the pace at which employees are leaving the organization. High attrition can signal issues with company culture, compensation, or management, while extremely low attrition might indicate stagnation.
The Attrition Rate Formula
The standard formula used by human resources professionals to calculate attrition over a specific period (usually monthly, quarterly, or annually) is:
Attrition Rate = (Number of Separations / Average Number of Employees) × 100
To use this formula effectively, you need three data points:
Employees at Start: The total headcount on the first day of the period.
Employees at End: The total headcount on the last day of the period.
Separations: The total number of employees who left the company during that period (both voluntary and involuntary).
Step-by-Step Calculation Example
Let's say you want to calculate the attrition rate for Q1. Here are your numbers:
Employees on Jan 1st: 200
Employees on Mar 31st: 210
Employees who left during Q1: 10
Step 1: Calculate the Average Workforce
(200 + 210) / 2 = 205
Step 2: Divide Separations by Average
10 / 205 = 0.0487
Step 3: Convert to Percentage
0.0487 × 100 = 4.87%
So, the attrition rate for Q1 was 4.87%.
Why Separations vs. Net Change?
It is important to input the specific number of separations rather than just looking at the difference between the start and end counts. A company might start with 100 employees and end with 100 employees. If looking only at the headcount, it seems stable. However, if 50 people left and 50 were hired, the attrition rate is actually 50%, representing massive instability. This calculator requires the explicit number of separations to ensure accuracy.
Interpreting Your Results
Once you have your rate, benchmark it against your industry. While zero attrition is rarely the goal (some turnover brings fresh ideas), rates significantly higher than the industry average can be costly.
Retail & Hospitality: Often see higher rates (30-60%+ annually).
Tech & Finance: Typically aim for lower rates (10-15% annually).
Government: Usually has the lowest attrition rates.
Types of Attrition
When analyzing your data, consider categorizing the separations to gain deeper insights:
Voluntary Attrition: Employees leaving for better offers or personal reasons. This is the metric most companies try to reduce.
Involuntary Attrition: Terminations or layoffs initiated by the company.
Internal Attrition: Employees moving to different departments within the same company (often excluded from company-wide attrition but relevant for department stats).
Use the calculator above to regularly track your metrics month-over-month to identify trends before they become systemic problems.