Employee Turnover Rate Calculator
Understanding employee turnover is crucial for any business. It measures the rate at which employees leave an organization over a specific period. A high turnover rate can be costly, impacting productivity, morale, and recruitment expenses. This calculator helps you determine your employee turnover rate.
function calculateTurnoverRate() {
var employeesAtStart = parseFloat(document.getElementById("employeesAtStart").value);
var employeesAtEnd = document.getElementById("employeesAtEnd").value);
var employeesWhoLeft = parseFloat(document.getElementById("employeesWhoLeft").value);
var resultDiv = document.getElementById("result");
resultDiv.innerHTML = ""; // Clear previous results
if (isNaN(employeesAtStart) || isNaN(employeesAtEnd) || isNaN(employeesWhoLeft)) {
resultDiv.innerHTML = "Please enter valid numbers for all fields.";
return;
}
if (employeesAtStart <= 0) {
resultDiv.innerHTML = "Number of employees at the start of the period must be greater than zero.";
return;
}
if (employeesWhoLeft employeesAtStart && employeesWhoLeft > employeesAtEnd) {
resultDiv.innerHTML = "Number of employees who left cannot be more than the total number of employees at the start or end of the period.";
return;
}
// Calculate the average number of employees
var averageEmployees = (employeesAtStart + employeesAtEnd) / 2;
// Calculate the turnover rate
var turnoverRate = (employeesWhoLeft / averageEmployees) * 100;
resultDiv.innerHTML = "
Turnover Rate Calculation
" +
"Average Number of Employees: " + averageEmployees.toFixed(2) + "" +
"
Employee Turnover Rate: " + turnoverRate.toFixed(2) + "%";
}
.calculator-container {
font-family: sans-serif;
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.calculator-container h2 {
text-align: center;
margin-bottom: 20px;
color: #333;
}
.calculator-inputs .input-group {
margin-bottom: 15px;
}
.calculator-inputs label {
display: block;
margin-bottom: 5px;
font-weight: bold;
color: #555;
}
.calculator-inputs input[type="number"] {
width: calc(100% – 22px);
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 1rem;
}
.calculator-inputs button {
width: 100%;
padding: 12px 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 1.1rem;
cursor: pointer;
transition: background-color 0.3s ease;
}
.calculator-inputs button:hover {
background-color: #0056b3;
}
.calculator-result {
margin-top: 25px;
padding: 15px;
background-color: #f8f9fa;
border: 1px solid #e0e0e0;
border-radius: 4px;
text-align: center;
}
.calculator-result h3 {
margin-top: 0;
color: #007bff;
}
.calculator-result p {
font-size: 1.1rem;
margin-bottom: 10px;
}
.calculator-result strong {
color: #28a745;
}